From 814fde32d9096296737cbc90c133c00b3bfde27f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Wed, 15 Aug 2012 03:02:32 -0700 Subject: [PATCH] Made the validation tests python3 friendly. --- tests/modeltests/validation/tests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modeltests/validation/tests.py b/tests/modeltests/validation/tests.py index 4f658203df..58b7b94e7f 100644 --- a/tests/modeltests/validation/tests.py +++ b/tests/modeltests/validation/tests.py @@ -79,7 +79,7 @@ class ModelFormsTests(TestCase): 'pub_date': '2010-1-10 14:49:00' } form = ArticleForm(data) - self.assertEqual(form.errors.keys(), []) + self.assertEqual(list(form.errors), []) article = form.save(commit=False) article.author = self.author article.save() @@ -95,7 +95,7 @@ class ModelFormsTests(TestCase): } article = Article(author_id=self.author.id) form = ArticleForm(data, instance=article) - self.assertEqual(form.errors.keys(), []) + self.assertEqual(list(form.errors), []) self.assertNotEqual(form.instance.pub_date, None) article = form.save() @@ -108,7 +108,7 @@ class ModelFormsTests(TestCase): } article = Article(author_id=self.author.id) form = ArticleForm(data, instance=article) - self.assertEqual(form.errors.keys(), ['pub_date']) + self.assertEqual(list(form.errors), ['pub_date']) class GenericIPAddressFieldTests(ValidationTestCase):