def test_delete_user(self): UserController.add_user(self.user_1) self.assertEqual(UserController.delete_user('nickname_1', 'email_1'), 'SUCCESS') self.assertEqual( UserController.delete_user('fake_nickname_1', 'fake_email_1'), 'SUCCESS')
def test_host_event(self): UserController.add_user(self.user_1) user_2 = UserController.retrieve_user('email', 'email_1') event_id = EventController.add_event(self.event_1) self.event_1.eventid = event_id self.assertIsNotNone(EventController.host_event(user_2, self.event_1)) UserController.delete_user('nickname_1', 'email_1')
def test_retrieve_user(self): UserController.delete_user('nickname_1', 'email_1') UserController.delete_user('nickname_2', 'email_2') UserController.add_user(self.user_1) self.assertIsInstance(UserController.retrieve_user('email', 'email_1'), UserModel) self.assertEqual(UserController.retrieve_user('email', 'email_2'), 'MISSING') UserController.delete_user('nickname_1', 'email_1')
def test_edit_user_1(self): UserController.delete_user('nickname_3', 'email_2') UserController.delete_user('nickname_2', 'email_2') UserController.add_user(self.user_2) user_3 = UserController.retrieve_user('email', 'email_2') user_3.nickname = 'nickname_3' self.assertIsNot(UserController.edit_user(user_3), 'MISSING' or 'DUPLICATE' or 'FAILURE') self.assertEqual(UserController.edit_user(user_3), 'MISSING') self.assertEqual( UserController.retrieve_user('email', 'email_2').nickname, 'nickname_3') UserController.delete_user('nickname_3', 'email_2')
def test_add_user(self): UserController.delete_user('nickname_1', 'email_1') self.assertEqual(UserController.add_user(self.user_1), 'SUCCESS') self.assertEqual(UserController.add_user(self.user_1), 'DUPLICATE') UserController.delete_user('nickname_1', 'email_1')