Fix and streamline the folder app view tests.

This commit is contained in:
Roberto Rosario
2017-01-07 01:03:51 -04:00
parent 3d90fdb490
commit a013ab0bf5
2 changed files with 116 additions and 145 deletions
+8
View File
@@ -76,6 +76,11 @@ class GenericViewTestCase(BaseTestCase):
data=data, follow=follow
)
def grant(self, permission):
self.role.permissions.add(
permission.stored_permission
)
def login(self, username, password):
logged_in = self.client.login(username=username, password=password)
@@ -84,6 +89,9 @@ class GenericViewTestCase(BaseTestCase):
self.assertTrue(logged_in)
self.assertTrue(user.is_authenticated())
def login_user(self):
self.login(username=TEST_USER_USERNAME, password=TEST_USER_PASSWORD)
def post(self, viewname, *args, **kwargs):
data = kwargs.pop('data', {})
follow = kwargs.pop('follow', False)