summaryrefslogtreecommitdiff
path: root/ishtar_common/tests.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-05-16 12:30:44 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-05-16 12:30:44 +0200
commita4c8f7d6af91d1d756897c61e484c3ea577024d5 (patch)
tree3e94b4b8fddda4fdf6f021cf11fbbc1f9d9a5e13 /ishtar_common/tests.py
parentcba39126fdf90bbe10f523fa185d33c90ca18593 (diff)
parent746cc873bec6b10a9c22fdf7e946928c6d3fd822 (diff)
downloadIshtar-a4c8f7d6af91d1d756897c61e484c3ea577024d5.tar.bz2
Ishtar-a4c8f7d6af91d1d756897c61e484c3ea577024d5.zip
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r--ishtar_common/tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py
index 095056c2e..a91a0ba58 100644
--- a/ishtar_common/tests.py
+++ b/ishtar_common/tests.py
@@ -288,6 +288,17 @@ class CacheTest(TestCase):
self.assertFalse('testy' in types)
+class AccessControlTest(TestCase):
+ def test_administrator(self):
+ admin, created = models.PersonType.objects.get_or_create(
+ txt_idx='administrator', defaults={'label': 'Admin'})
+ user, created = User.objects.get_or_create(username='myusername')
+ user.is_superuser = True
+ user.save()
+ ishtar_user = models.IshtarUser.objects.get(username=user.username)
+ self.assertIn(admin, ishtar_user.person.person_types.all())
+
+
class AdminGenTypeTest(TestCase):
fixtures = [settings.ROOT_PATH +
'../fixtures/initial_data-auth-fr.json',