예제 #1
0
 def test_rolefinder_by_user(self):
     user = User.objects.create(username='******')
     self.assertEqual(Scientist.get_users().count(), 0)
     Scientist.assign(user)
     self.assertEqual(RoleFinder.by_user(user)[0], Scientist)
     self.assertEqual(len(RoleFinder.by_user(user)), 1)
     Scientist.remove(user)
예제 #2
0
 def test_get_users(self):
     user = User.objects.create(username='******')
     self.assertEqual(Scientist.get_users().count(), 0)
     Scientist.assign(user)
     self.assertEqual(Scientist.get_users().count(), 1)
     Scientist.remove(user)
     self.assertEqual(Scientist.get_users().count(), 0)
예제 #3
0
 def test_remove(self):
     user = User.objects.create(username='******')
     self.assertEqual(user.groups.count(), 0)
     Scientist.assign(user)
     self.assertEqual(user.groups.count(), 1)
     Scientist.remove(user)
     self.assertEqual(user.groups.count(), 0)
예제 #4
0
 def test_rolefinder_by_user(self):
     user = User.objects.create(username='******')
     self.assertEqual(Scientist.get_users().count(), 0)
     Scientist.assign(user)
     self.assertEqual(RoleFinder.by_user(user)[0], Scientist)
     self.assertEqual(len(RoleFinder.by_user(user)), 1)
     Scientist.remove(user)
예제 #5
0
 def test_get_users(self):
     user = User.objects.create(username='******')
     self.assertEqual(Scientist.get_users().count(), 0)
     Scientist.assign(user)
     self.assertEqual(Scientist.get_users().count(), 1)
     Scientist.remove(user)
     self.assertEqual(Scientist.get_users().count(), 0)
예제 #6
0
 def test_remove(self):
     user = User.objects.create(username='******')
     self.assertEqual(user.groups.count(), 0)
     Scientist.assign(user)
     self.assertEqual(user.groups.count(), 1)
     Scientist.remove(user)
     self.assertEqual(user.groups.count(), 0)