def test_delete_user(): """ Test user deleting. """ user = users.get("test_user") user.delete() assert_raises(exceptions.NonExistentUser, users.get, "test_user")
def test_user_update(): """ Test user updating. """ user = users.get("user") user.name = "test_user" assert user.name == "test_user"
def test_participant_event_reverse(): """ Test user events """ event = events.get(1) user = users.get(1) assert event in user.participated
def test_user_get(): """ Test user getting. """ user = None user = users.get("user") assert type(user) == models.User
def test_participant_event(): """ Test event participant adding """ event = events.get(1) user = users.get(1) event.participants.append(user) assert user in event.participants
def test_user_game_relation_user(): """ Test user-game relationship from a user viewpoint. """ user = users.get("test_user") game = games.get("Flingler") game2 = games.get("Flingler II") user.games.append(game) user.games.append(game2) assert game in user.games assert game2 in user.games