summaryrefslogtreecommitdiff
path: root/tests/test_alchemy.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2014-05-18 12:34:19 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2014-05-18 14:18:49 +0200
commit395744736691b3412dbedaffa8735e248a70c3c1 (patch)
tree4e4e67f8a907edcad3984a843707cf9b5dcad375 /tests/test_alchemy.py
parent47b34e933f94e71e7aabd81cd1e065a807a55276 (diff)
downloadfactory-boy-395744736691b3412dbedaffa8735e248a70c3c1.tar
factory-boy-395744736691b3412dbedaffa8735e248a70c3c1.tar.gz
Switch tests to class Meta.
Diffstat (limited to 'tests/test_alchemy.py')
-rw-r--r--tests/test_alchemy.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/test_alchemy.py b/tests/test_alchemy.py
index c94e425..4526ad1 100644
--- a/tests/test_alchemy.py
+++ b/tests/test_alchemy.py
@@ -36,7 +36,8 @@ if sqlalchemy:
else:
class Fake(object):
- FACTORY_SESSION = None
+ class Meta:
+ sqlalchemy_session = None
models = Fake()
models.StandardModel = Fake()
@@ -46,16 +47,18 @@ else:
class StandardFactory(SQLAlchemyModelFactory):
- FACTORY_FOR = models.StandardModel
- FACTORY_SESSION = models.session
+ class Meta:
+ target = models.StandardModel
+ sqlalchemy_session = models.session
id = factory.Sequence(lambda n: n)
foo = factory.Sequence(lambda n: 'foo%d' % n)
class NonIntegerPkFactory(SQLAlchemyModelFactory):
- FACTORY_FOR = models.NonIntegerPk
- FACTORY_SESSION = models.session
+ class Meta:
+ target = models.NonIntegerPk
+ sqlalchemy_session = models.session
id = factory.Sequence(lambda n: 'foo%d' % n)