Skip to content

Commit ee63cfc

Browse files
Update docs/tests/test_models.py
Co-authored-by: Baptiste Mispelon <[email protected]>
1 parent 5a025ca commit ee63cfc

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/tests/test_models.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,14 @@ def test_document_url(self):
609609
},
610610
]
611611
Document.objects.bulk_create(Document(**doc) for doc in documents)
612-
document_index, document_detail = self.release.documents.order_by("path")
613-
self.assertEqual(
614-
document_index.get_absolute_url(),
615-
"http://docs.djangoproject.localhost:8000/en/1.2.3/",
616-
)
617-
self.assertEqual(
618-
document_detail.get_absolute_url(),
619-
"http://docs.djangoproject.localhost:8000"
620-
"/en/1.2.3/topics/http/generic-views/",
612+
self.assertQuerySetEqual(
613+
self.release.documents.order_by("path"),
614+
[
615+
"http://docs.djangoproject.localhost:8000/en/1.2.3/",
616+
"http://docs.djangoproject.localhost:8000/en/1.2.3/"
617+
"topics/http/generic-views/",
618+
],
619+
transform=lambda doc: doc.get_absolute_url(),
621620
)
622621

623622
def test_document_url_documentation_category_website(self):

0 commit comments

Comments
 (0)