From 9b30c334b110d00f66dbd5800ffdf7f93ae63f47 Mon Sep 17 00:00:00 2001 From: Burathar Date: Sun, 19 Jul 2020 17:04:32 +0200 Subject: [PATCH] Replace game.game_player with game.player --- app/tests/test_models.py | 24 ++++++++++++------------ the_hunt.py | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/tests/test_models.py b/app/tests/test_models.py index 48d77f1..01071b6 100644 --- a/app/tests/test_models.py +++ b/app/tests/test_models.py @@ -27,8 +27,8 @@ class ModelsCase(unittest.TestCase): u1 = User(name='Henk') u2 = User(name='Alfred') - g1.game_players.append(GamePlayer(player=u1, role=Role.owner)) - g1.game_players.append(GamePlayer(player=u2, role=Role.bunny)) + g1.players.append(GamePlayer(player=u1, role=Role.owner)) + g1.players.append(GamePlayer(player=u2, role=Role.bunny)) db.session.add(g1) db.session.commit() @@ -44,11 +44,11 @@ class ModelsCase(unittest.TestCase): u2 = User(name='Alfred') u3 = User(name='Sasha') - g1.game_players.append(GamePlayer(player=u1, role=Role.owner)) - g1.game_players.append(GamePlayer(player=u2, role=Role.bunny)) + g1.players.append(GamePlayer(player=u1, role=Role.owner)) + g1.players.append(GamePlayer(player=u2, role=Role.bunny)) - g2.game_players.append(GamePlayer(player=u1, role=Role.hunter)) - g2.game_players.append(GamePlayer(player=u3, role=Role.bunny)) + g2.players.append(GamePlayer(player=u1, role=Role.hunter)) + g2.players.append(GamePlayer(player=u3, role=Role.bunny)) db.session.add(g1) @@ -65,8 +65,8 @@ class ModelsCase(unittest.TestCase): g2 = Game(name='AnotherGame') u1 = User(name='Henk') - g1.game_players.append(GamePlayer(player=u1, role=Role.owner)) - g2.game_players.append(GamePlayer(player=u1, role=Role.bunny)) + g1.players.append(GamePlayer(player=u1, role=Role.owner)) + g2.players.append(GamePlayer(player=u1, role=Role.bunny)) o1 = Objective(name='o1') o1.set_hash() @@ -92,10 +92,10 @@ class ModelsCase(unittest.TestCase): u4 = User(name='Demian') u5 = User(name='Karl') - g1.game_players.append(GamePlayer(player=u1, role=Role.owner)) - g1.game_players.append(GamePlayer(player=u2, role=Role.bunny)) - g1.game_players.append(GamePlayer(player=u3, role=Role.hunter)) - g1.game_players.append(GamePlayer(player=u4, role=Role.none)) + g1.players.append(GamePlayer(player=u1, role=Role.owner)) + g1.players.append(GamePlayer(player=u2, role=Role.bunny)) + g1.players.append(GamePlayer(player=u3, role=Role.hunter)) + g1.players.append(GamePlayer(player=u4, role=Role.none)) db.session.add(g1) db.session.add(u5) diff --git a/the_hunt.py b/the_hunt.py index 2220836..de82fff 100755 --- a/the_hunt.py +++ b/the_hunt.py @@ -24,15 +24,15 @@ def create_objects(): u4 = User(name='Emma') u5 = User(name='Demi') - g1.game_players.append(GamePlayer(user=u1, role=Role.owner)) - g1.game_players.append(GamePlayer(user=u2, role=Role.hunter)) - g1.game_players.append(GamePlayer(user=u3, role=Role.hunter)) - g1.game_players.append(GamePlayer(user=u4, role=Role.bunny)) - g1.game_players.append(GamePlayer(user=u5, role=Role.bunny)) + g1.players.append(GamePlayer(user=u1, role=Role.owner)) + g1.players.append(GamePlayer(user=u2, role=Role.hunter)) + g1.players.append(GamePlayer(user=u3, role=Role.hunter)) + g1.players.append(GamePlayer(user=u4, role=Role.bunny)) + g1.players.append(GamePlayer(user=u5, role=Role.bunny)) - g2.game_players.append(GamePlayer(user=u1, role=Role.bunny)) - g2.game_players.append(GamePlayer(user=u2, role=Role.owner)) - g2.game_players.append(GamePlayer(user=u3, role=Role.hunter)) + g2.players.append(GamePlayer(user=u1, role=Role.bunny)) + g2.players.append(GamePlayer(user=u2, role=Role.owner)) + g2.players.append(GamePlayer(user=u3, role=Role.hunter)) db.session.add(g1) db.session.add(g2)