Skip to content

Commit

Permalink
test(core): Correct lookup for model history test setup
Browse files Browse the repository at this point in the history
ref: #605 #602
  • Loading branch information
jon-nfc committed Feb 19, 2025
1 parent 13d697e commit 94737e7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.contrib.auth.models import Permission, User
from django.contrib.auth.models import ContentType, Permission, User
from django.contrib.contenttypes.models import ContentType
from django.shortcuts import reverse
from django.test import Client, TestCase
Expand Down Expand Up @@ -160,7 +160,12 @@ def setUpTestData(self):
user = self.view_user
)

self.item = self.model.objects.all()[0]
self.item = self.model.objects.filter(
content_type = ContentType.objects.get(
app_label = self.device._meta.app_label,
model = self.device._meta.model_name
)
)[0]


self.url_kwargs = {
Expand Down

0 comments on commit 94737e7

Please sign in to comment.