def test_remove_group_check_users(self): # setup testuser = self.get_random_username() create_user(testuser) testgroup = self.get_random_username() create_group(testgroup) group_add(testgroup, testuser) groupid = self.db.groups.find_one({'name': testgroup})['_id'] # action remove_group(testgroup) # tests groupdoc = self.db.groups.find_one({'name': testgroup}) self.assertEqual(groupdoc, None) userdoc = self.db.users.find({'groups': groupid}) self.assertEqual(usersdoc, None)
def test_remove_group(self): testgroup = self.get_random_username() create_group(testgroup) remove_group(testgroup) groupdoc = self.db.groups.find_one({'name': testgroup}) self.assertEqual(groupdoc, None)
def test_remove_non_existent_group(self): testgroup = self.get_random_username() remove_group(testgroup)