Merge pull request #350 from sartography/367-Call-Activity

Fix failing tests for #367 Call Activity
This commit is contained in:
Mike Cullerton 2021-08-06 12:10:57 -04:00 committed by GitHub
commit 08a2c3688d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -16,8 +16,11 @@ class ExampleDataLoader:
@staticmethod
def clean_db():
session.flush() # Clear out any transactions before deleting it all to avoid spurious errors.
engine = session.bind.engine
connection = engine.connect()
for table in reversed(db.metadata.sorted_tables):
session.execute(table.delete())
if engine.dialect.has_table(connection, table):
session.execute(table.delete())
session.commit()
session.flush()