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)
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)
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)