Skip to content

Commit

Permalink
More debugging is needed?!
Browse files Browse the repository at this point in the history
  • Loading branch information
goerch committed Nov 10, 2023
1 parent 3e13ba5 commit 667ce6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/fixtures/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def insert_model1_data(session: Session, count: int) -> List[Model1]:
@contextmanager
def model1_data(session: Session, count: int = MODEL1_DATA_SIZE, delete: bool = False) -> List[Model1]:
if delete:
session.query(Model1).delete()
rows = session.query(Model1).delete()
print(f"Deleting {rows} rows in model data")
session.commit()

model1_collection = insert_model1_data(session, count)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,8 +960,9 @@ def test_get_item_not_found(self):
"""
client = self.app.test_client()
token = self.login(client, USERNAME_ADMIN, PASSWORD_ADMIN)
with model1_data(self.appbuilder.session, 1, True):
with model1_data(self.appbuilder.session, 1, True) as models:
model_id = MODEL1_DATA_SIZE + 1
self.assertTrue(model_id not in [model.id for model in models])
rv = self.auth_client_get(client, token, f"api/v1/model1api/{model_id}")
self.assertEqual(rv.status_code, 404)

Expand Down

0 comments on commit 667ce6e

Please sign in to comment.