From eccc77712f3d6c8eb95c2855c095d0fe8cde8363 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Mon, 27 May 2024 10:41:57 +0200 Subject: [PATCH] Added deletion test + Added a test to check if deletion works. --- zeeguu/core/test/test_user.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zeeguu/core/test/test_user.py b/zeeguu/core/test/test_user.py index 26233b47..5d1a33eb 100644 --- a/zeeguu/core/test/test_user.py +++ b/zeeguu/core/test/test_user.py @@ -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): @@ -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)