def test_game_by_code(self): # make new game g = Game("molding") self.db.session.add(g) self.db.session.commit() # get by code CODE = g.code g_test = Game.by_code(CODE) assert g == g_test
def test_game_challenge(self): word = 'element' response = self.client.post(url_for("game.challenge"), data=json.dumps(dict(word=word)), content_type='application/json') assert response.status_code == 200 result = response.get_data(as_text=True) assert result assert Game.by_code(result).word == word