Skip to content

Commit

Permalink
Added deletion test
Browse files Browse the repository at this point in the history
+ Added a test to check if deletion works.
  • Loading branch information
tfnribeiro committed May 27, 2024
1 parent 87e32a5 commit eccc777
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion zeeguu/core/test/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
from zeeguu.core.test.model_test_mixin import ModelTestMixIn
from zeeguu.core.test.rules.bookmark_rule import BookmarkRule
from zeeguu.core.test.rules.user_rule import UserRule
from zeeguu.core.model import User
from zeeguu.core.model import User, Session
from zeeguu.core.model import db
from zeeguu.core.account_management.user_account_deletion import delete_user_account


class UserTest(ModelTestMixIn):
Expand Down Expand Up @@ -151,3 +152,10 @@ def __truncate_time_from_date(self, date_with_time):
return datetime(
date_with_time.year, date_with_time.month, date_with_time.day, 0, 0, 0
)

def test_user_deletion(self):
new_session = Session.create_for_user(self.user)
db.session.add(new_session)
db.session.commit()
delete_user_account(db.session, new_session.uuid)
assert not User.exists(self.user)

0 comments on commit eccc777

Please sign in to comment.