You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
970 B

import unittest
from app import create_app, db
from app.models import Player, Game, Role, GamePlayer, Objective, ObjectiveMinimalEncoder, LocationEncoder
from config import Config
class TestConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = 'sqlite://'
class RoutesCase(unittest.TestCase):
def setUp(self):
self.app = create_app(TestConfig)
self.app_context = self.app.app_context()
self.app_context.push()
db.create_all()
def tearDown(self):
db.session.remove()
db.drop_all()
self.app_context.pop()
def test_is_game_owner(self):
g = Game(name='TestGame')
p1 = Player(name='Henk')
p2 = Player(name='Alfred')
g.players.append(p1)
g.players.append(p2)
db.session.append(g)
db.session.commit()
self.assertEqual(True, True)
self.assertFalse('Foo'.isupper())
if __name__ == '__main__':
unittest.main(verbosity=2)