solo handles this testing

This commit is contained in:
Joel Falknau 2024-12-28 13:05:50 +10:00
parent 12efafc90d
commit 28cf896e61
No known key found for this signature in database

View File

@ -1,5 +1,5 @@
from django.db.utils import IntegrityError
from allianceauth.analytics.models import AnalyticsIdentifier
from django.core.exceptions import ValidationError
from django.test.testcases import TestCase
@ -15,13 +15,3 @@ class TestAnalyticsIdentifier(TestCase):
def test_identifier_random(self):
self.assertNotEqual(AnalyticsIdentifier.get_solo(), uuid4)
def test_identifier_singular(self):
AnalyticsIdentifier.get_solo().delete()
AnalyticsIdentifier.objects.create(identifier=uuid_1)
# Yeah i have multiple asserts here, they all do the same thing
with self.assertRaises(ValidationError):
AnalyticsIdentifier.objects.create(identifier=uuid_2)
self.assertEqual(AnalyticsIdentifier.objects.count(), 1)
self.assertEqual(AnalyticsIdentifier.objects.get(
pk=1).identifier, UUID(uuid_1))