Skip to content

Commit

Permalink
Add unit test for api_keys.deleted column
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Sep 30, 2022
1 parent e7c24ef commit 0356c2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/unit/data/model/mapping/test_gxy_model_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,16 @@ def test_table(self, cls_):
assert cls_.__tablename__ == "api_keys"

def test_columns(self, session, cls_, user):
create_time, user_id, key = now(), user.id, get_unique_value()
obj = cls_(user_id=user_id, key=key, create_time=create_time)
create_time, user_id, key, deleted = now(), user.id, get_unique_value(), True
obj = cls_(user_id=user_id, key=key, create_time=create_time, deleted=deleted)

with dbcleanup(session, obj) as obj_id:
stored_obj = get_stored_obj(session, cls_, obj_id)
assert stored_obj.id == obj_id
assert stored_obj.create_time == create_time
assert stored_obj.user_id == user_id
assert stored_obj.key == key
assert stored_obj.deleted == deleted

def test_relationships(self, session, cls_, user):
obj = cls_(user_id=user.id, key=get_unique_value())
Expand Down

0 comments on commit 0356c2e

Please sign in to comment.