Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JVT038 committed Jan 29, 2024
1 parent d98ff33 commit 5678e0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_database.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from email.policy import default
from config import Config
from metatube.init import Default
from metatube import create_app, db
Expand Down Expand Up @@ -39,6 +38,11 @@ def testAutoCreation(self):
db.drop_all()
relative_url = 'sqlite:///' + os.path.join('metatube', Config.SQLALCHEMY_DATABASE_URI.replace('sqlite:///', ''))
default = Default(self.app, relative_url)
migrationsPath = os.path.join(Config.BASE_DIR, 'migrations')
if os.path.exists(migrationsPath) and os.path.isdir(migrationsPath) and (os.path.exists(os.path.join(migrationsPath, 'env.py')) and os.path.exists(os.path.join(migrationsPath, 'versions'))):
default.init_db()
else:
default.init_db(False)
self.assertTrue(default.init_db())

def testConfigTable(self):
Expand Down

0 comments on commit 5678e0a

Please sign in to comment.