Exemple #1
0
def test_delete_user():
    """ Test user deleting. """

    user = users.get("test_user")
    user.delete()

    assert_raises(exceptions.NonExistentUser, users.get, "test_user")
Exemple #2
0
def test_user_update():
    """ Test user updating. """

    user = users.get("user")
    user.name = "test_user"

    assert user.name == "test_user"
Exemple #3
0
def test_participant_event_reverse():
    """ Test user events """

    event = events.get(1)
    user = users.get(1)

    assert event in user.participated
Exemple #4
0
def test_delete_user():
    """ Test user deleting. """

    user = users.get("test_user")
    user.delete()

    assert_raises(exceptions.NonExistentUser, users.get, "test_user")
Exemple #5
0
def test_user_get():
    """ Test user getting. """

    user = None
    user = users.get("user")

    assert type(user) == models.User
Exemple #6
0
def test_participant_event_reverse():
    """ Test user events """

    event = events.get(1)
    user = users.get(1)

    assert event in user.participated
Exemple #7
0
def test_user_update():
    """ Test user updating. """

    user = users.get("user")
    user.name = "test_user"

    assert user.name == "test_user"
Exemple #8
0
def test_user_get():
    """ Test user getting. """

    user = None
    user = users.get("user")

    assert type(user) == models.User
Exemple #9
0
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
Exemple #10
0
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
Exemple #11
0
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
Exemple #12
0
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