summaryrefslogtreecommitdiff
path: root/tests/test_django.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polyconseil.fr>2014-08-21 09:28:51 +0200
committerRaphaël Barrois <raphael.barrois@polyconseil.fr>2014-08-21 09:28:51 +0200
commit82988e154391cc37f81eb398bbfa91f30f524349 (patch)
tree0563c94eec993963d03208f05f3638b7546ce1e9 /tests/test_django.py
parent87f8cc0cc0d2f48f489c81b8c93e8ab6de6cff26 (diff)
downloadfactory-boy-82988e154391cc37f81eb398bbfa91f30f524349.tar
factory-boy-82988e154391cc37f81eb398bbfa91f30f524349.tar.gz
tests: Update to Django new 'duplicate file' mechanism.
Diffstat (limited to 'tests/test_django.py')
-rw-r--r--tests/test_django.py6
1 files changed, 4 insertions, 2 deletions
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)