summaryrefslogtreecommitdiff
path: root/tests/serializers
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-04-14 12:54:27 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-04-18 07:05:52 +0200
commit8e89dfe1c24540d33b577377af633694ff57f505 (patch)
tree127b5b495d97a89e88e943470b8a57a2f8ce907f /tests/serializers
parent331a460f8f2e4f447b68fba491464b68c9b21fd1 (diff)
downloaddjango-8e89dfe1c24540d33b577377af633694ff57f505.tar.gz
Fixed various tests on MySQL with MyISAM storage engine.
Diffstat (limited to 'tests/serializers')
-rw-r--r--tests/serializers/test_natural.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/serializers/test_natural.py b/tests/serializers/test_natural.py
index 6b6cfae6f3..b5b35708c6 100644
--- a/tests/serializers/test_natural.py
+++ b/tests/serializers/test_natural.py
@@ -78,11 +78,13 @@ def natural_key_test(self, format):
# Deserialize and test.
books = list(serializers.deserialize(format, string_data))
- self.assertEqual(len(books), 2)
- self.assertEqual(books[0].object.title, book1["title"])
- self.assertEqual(books[0].object.pk, adrian.pk)
- self.assertEqual(books[1].object.title, book2["title"])
- self.assertIsNone(books[1].object.pk)
+ self.assertCountEqual(
+ [(book.object.title, book.object.pk) for book in books],
+ [
+ (book1["title"], adrian.pk),
+ (book2["title"], None),
+ ],
+ )
def natural_pk_mti_test(self, format):