-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #370 from ropable/master
Increment project version
- Loading branch information
Showing
9 changed files
with
118 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from django.urls import reverse | ||
from itassets.test_api import ApiTestCase | ||
|
||
|
||
class ViewsTestCase(ApiTestCase): | ||
|
||
def test_view_address_book(self): | ||
"""Test the Address Book view | ||
""" | ||
url = reverse("address_book") | ||
resp = self.client.get(url) | ||
self.assertEqual(resp.status_code, 200) | ||
self.assertContains(resp, self.user1.name) | ||
self.assertContains(resp, self.user2.name) | ||
# Check the exclusion rules. | ||
self.assertNotContains(resp, self.inactive_user.name) | ||
self.assertNotContains(resp, self.shared_acct.name) | ||
self.assertNotContains(resp, self.contractor.name) | ||
|
||
def test_view_address_book_filtered(self): | ||
"""Test the filtered Address Book view | ||
""" | ||
url = reverse("address_book") + f"?q={self.user1.name}" | ||
resp = self.client.get(url) | ||
self.assertEqual(resp.status_code, 200) | ||
self.assertContains(resp, self.user1.name) | ||
self.assertNotContains(resp, self.user2.name) | ||
|
||
def test_view_user_accounts(self): | ||
"""Test the User Accounts view | ||
""" | ||
url = reverse("user_accounts") | ||
resp = self.client.get(url) | ||
self.assertEqual(resp.status_code, 200) | ||
self.assertContains(resp, self.user1.name) | ||
self.assertContains(resp, self.user2.name) | ||
# Remove the license from a user and re-check. | ||
self.user1.assigned_licences = [] | ||
self.user1.save() | ||
resp = self.client.get(url) | ||
self.assertNotContains(resp, self.user1.name) | ||
self.assertContains(resp, self.user2.name) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.