def test_delete_join_4(self) -> None: """ test delete_join: user and event don’t exist """ Join.create_join(Join(self.user, self.event)) self.assertTrue(Join.user_is_attend(self.user, self.event)) Join.delete_join(Join('1', '1')) self.assertTrue(Join.user_is_attend(self.user, self.event))
def test_delete_join_3(self) -> None: """ test delete_join: user doesn’t exist, event exists """ Join.create_join(Join(self.user, self.event)) self.assertTrue(Join.user_is_attend(self.user, self.event)) Join.delete_join(Join('1', self.event)) self.assertTrue(Join.user_is_attend(self.user, self.event))
def test_get_attendees_by_event_1(self): """ Test function get_attendees_by_event Event exist """ user = "******" event = create_event() event.category = "test" event_id = Event.create_event(event) Join.create_join(Join(user, event_id)) users = User.get_attendees_by_event(event_id) self.assertEqual(users[0].email, user) Join.delete_join(Join(user, event_id)) Event.delete_event_by_id(event_id)
def tearDown(self) -> None: Join.delete_join(Join(self.user, self.event)) Event.delete_event_by_id(self.event) User.delete_user_by_email(self.user)