diff options
Diffstat (limited to 'ishtar_common/tests.py')
-rw-r--r-- | ishtar_common/tests.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 7bce12a4d..4ee47d723 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -416,12 +416,21 @@ class AccessControlTest(TestCase): user.save() ishtar_user = models.IshtarUser.objects.get( user_ptr__username='myusername') - self.assertIn(admin, ishtar_user.person.person_types.all()) + self.assertEqual( + models.UserProfile.objects.filter( + person__ishtaruser=ishtar_user, + profile_type__txt_idx='administrator' + ).count(), 1 + ) user = ishtar_user.user_ptr user.is_superuser = False user.save() - ishtar_user = models.IshtarUser.objects.get( - user_ptr__username='myusername') + self.assertEqual( + models.UserProfile.objects.filter( + person__ishtaruser=ishtar_user, + profile_type__txt_idx='administrator' + ).count(), 0 + ) self.assertNotIn(admin, ishtar_user.person.person_types.all()) @@ -1153,6 +1162,11 @@ class ImportTest(TestCase): class IshtarSiteProfileTest(TestCase): + fixtures = [settings.ROOT_PATH + + '../fixtures/initial_data-auth-fr.json', + settings.ROOT_PATH + + '../ishtar_common/fixtures/initial_data-fr.json',] + def testRelevance(self): cache.set('default-ishtarsiteprofile-is-current-profile', None, settings.CACHE_TIMEOUT) |