Merge branch 'feature/transition_acls' into feature/hotfix

This commit is contained in:
Roberto Rosario
2017-03-13 23:25:42 -04:00
16 changed files with 537 additions and 134 deletions
+14
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,15 @@ 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 login_admin_user(self):
self.login(username=TEST_ADMIN_USERNAME, password=TEST_ADMIN_PASSWORD)
def logout(self):
self.client.logout()
def post(self, viewname, *args, **kwargs):
data = kwargs.pop('data', {})
follow = kwargs.pop('follow', False)