From 82988e154391cc37f81eb398bbfa91f30f524349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Barrois?= Date: Thu, 21 Aug 2014 09:28:51 +0200 Subject: tests: Update to Django new 'duplicate file' mechanism. --- tests/test_django.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_django.py b/tests/test_django.py index 41a26cf..fd9c876 100644 --- a/tests/test_django.py +++ b/tests/test_django.py @@ -430,7 +430,8 @@ class DjangoFileFieldTestCase(unittest.TestCase): o2 = WithFileFactory.build(afile=o1.afile) self.assertIsNone(o2.pk) self.assertEqual(b'example_data\n', o2.afile.read()) - self.assertEqual('django/example_1.data', o2.afile.name) + self.assertNotEqual('django/example.data', o2.afile.name) + self.assertRegexpMatches(o2.afile.name, r'django/example_\w+.data') def test_no_file(self): o = WithFileFactory.build(afile=None) @@ -547,7 +548,8 @@ class DjangoImageFieldTestCase(unittest.TestCase): self.assertIsNone(o2.pk) # Image file for a 42x42 green jpeg: 301 bytes long. self.assertEqual(301, len(o2.animage.read())) - self.assertEqual('django/example_1.jpeg', o2.animage.name) + self.assertNotEqual('django/example.jpeg', o2.animage.name) + self.assertRegexpMatches(o2.animage.name, r'django/example_\w+.jpeg') def test_no_file(self): o = WithImageFactory.build(animage=None) -- cgit v1.2.3