summaryrefslogtreecommitdiff
path: root/tests/test_containers.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-08-17 01:22:47 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-08-17 01:22:47 +0200
commit2611973bb62d38ff23471fdc115cdd09e351be50 (patch)
tree113cf3c40090b02d10f210ad20224cc40492f3dd /tests/test_containers.py
parent20515351bb0db936873db5dae133ea317050079d (diff)
downloadfactory-boy-2611973bb62d38ff23471fdc115cdd09e351be50.tar
factory-boy-2611973bb62d38ff23471fdc115cdd09e351be50.tar.gz
Add support for passing non-kwarg parameters to factories.
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
Diffstat (limited to 'tests/test_containers.py')
-rw-r--r--tests/test_containers.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_containers.py b/tests/test_containers.py
index 797c480..b1ed6ed 100644
--- a/tests/test_containers.py
+++ b/tests/test_containers.py
@@ -178,6 +178,17 @@ class DeclarationDictTestCase(unittest.TestCase):
self.assertEqual(set(['one', 'three']), set(d))
self.assertEqual(set([1, 3]), set(d.values()))
+ def test_update_with_public_ignores_factory_attributes(self):
+ """Ensure that a DeclarationDict ignores FACTORY_ keys."""
+ d = containers.DeclarationDict()
+ d.update_with_public({
+ 'one': 1,
+ 'FACTORY_FOR': 2,
+ 'FACTORY_ARG_PARAMETERS': 3,
+ })
+ self.assertEqual(['one'], list(d))
+ self.assertEqual([1], list(d.values()))
+
class AttributeBuilderTestCase(unittest.TestCase):
def test_empty(self):