Consolidate repeated test user logins

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-04-11 22:57:39 -04:00
parent ae814a18c5
commit 0188afcd54
14 changed files with 69 additions and 212 deletions

View File

@@ -13,9 +13,11 @@ from .literals import TEST_ERROR_LOG_ENTRY_RESULT
class CommonViewTestCase(GenericViewTestCase):
def test_about_view(self):
def setUp(self):
super(CommonViewTestCase, self).setUp()
self.login_user()
def test_about_view(self):
response = self.get('common:about_view')
self.assertContains(response, text='About', status_code=200)
@@ -43,7 +45,6 @@ class CommonViewTestCase(GenericViewTestCase):
def test_object_error_list_view_with_permissions(self):
self._create_error_log_entry()
self.login_user()
self.grant_access(
obj=self.user, permission=permission_error_log_view
)
@@ -58,8 +59,6 @@ class CommonViewTestCase(GenericViewTestCase):
def test_object_error_list_view_no_permissions(self):
self._create_error_log_entry()
self.login_user()
response = self._request_object_error_log_list()
self.assertNotContains(