Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made the validation tests python3 friendly.

  • Loading branch information...
commit 814fde32d9096296737cbc90c133c00b3bfde27f 1 parent ea1e8b3
@alex alex authored Alex Gaynor committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/modeltests/validation/tests.py
View
6 tests/modeltests/validation/tests.py
@@ -79,7 +79,7 @@ def test_partial_validation(self):
'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 @@ def test_validation_with_empty_blank_field(self):
}
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 @@ def test_validation_with_invalid_blank_field(self):
}
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):
Please sign in to comment.
Something went wrong with that request. Please try again.