summaryrefslogtreecommitdiff
path: root/tests/test_declarations.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_declarations.py')
-rw-r--r--tests/test_declarations.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_declarations.py b/tests/test_declarations.py
index 4c08dfa..90e54c2 100644
--- a/tests/test_declarations.py
+++ b/tests/test_declarations.py
@@ -210,6 +210,17 @@ class RelatedFactoryTestCase(unittest.TestCase):
# IMPORTANT: restore attribute.
datetime.date = orig_date
+ def test_deprecate_name(self):
+ with warnings.catch_warnings(record=True) as w:
+
+ warnings.simplefilter('always')
+ f = declarations.RelatedFactory('datetime.date', name='blah')
+
+ self.assertEqual('blah', f.name)
+ self.assertEqual(1, len(w))
+ self.assertIn('RelatedFactory', str(w[0].message))
+ self.assertIn('factory_related_name', str(w[0].message))
+
class PostGenerationMethodCallTestCase(unittest.TestCase):
def setUp(self):