We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d43afa commit 134f339Copy full SHA for 134f339
wger/trophies/tests/test_services.py
@@ -106,6 +106,14 @@ def test_handle_workout_deletion(self):
106
self.assertEqual(stats.total_weight_lifted, Decimal('0'))
107
108
109
+ def test_get_or_create_statistics_deleted_user(self):
110
+ """
111
+ Test get_or_create raises DoesNotExist for deleted user
112
113
+ with patch.object(User.objects, 'filter') as mock_filter:
114
+ mock_filter.return_value.exists.return_value = False
115
+ with self.assertRaises(User.DoesNotExist):
116
+ UserStatisticsService.get_or_create_statistics(self.user)
117
class TrophyServiceTestCase(WgerTestCase):
118
"""
119
Test the TrophyService
0 commit comments