summaryrefslogtreecommitdiff
path: root/factory/base.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2014-11-18 00:35:19 +0100
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2014-11-18 00:39:52 +0100
commit336ea5ac8b2d922fb54f99edd55d4773dd126934 (patch)
treef46ee3cbbd9f1d6ab4ad4af122b66371cdc2eb85 /factory/base.py
parent13d310fa14f4e4b9a559f8b7887f2a2492357013 (diff)
downloadfactory-boy-336ea5ac8b2d922fb54f99edd55d4773dd126934.tar
factory-boy-336ea5ac8b2d922fb54f99edd55d4773dd126934.tar.gz
Remove deprecated features.
This disables the ``FACTORY_FOR`` syntax and related parameters, that should be declared through ``class Meta``.
Diffstat (limited to 'factory/base.py')
-rw-r--r--factory/base.py26
1 files changed, 0 insertions, 26 deletions
diff --git a/factory/base.py b/factory/base.py
index 9e07899..efff976 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -21,7 +21,6 @@
# THE SOFTWARE.
import logging
-import warnings
from . import containers
from . import declarations
@@ -109,23 +108,6 @@ class FactoryMetaClass(type):
attrs_meta = attrs.pop('Meta', None)
- oldstyle_attrs = {}
- converted_attrs = {}
- for old_name, new_name in base_factory._OLDSTYLE_ATTRIBUTES.items():
- if old_name in attrs:
- oldstyle_attrs[old_name] = new_name
- converted_attrs[new_name] = attrs.pop(old_name)
- if oldstyle_attrs:
- warnings.warn(
- "Declaring any of %s at class-level is deprecated"
- " and will be removed in the future. Please set them"
- " as %s attributes of a 'class Meta' attribute." % (
- ', '.join(oldstyle_attrs.keys()),
- ', '.join(oldstyle_attrs.values()),
- ),
- PendingDeprecationWarning, 2)
- attrs_meta = type('Meta', (object,), converted_attrs)
-
base_meta = resolve_attribute('_meta', bases)
options_class = resolve_attribute('_options_class', bases, FactoryOptions)
@@ -322,14 +304,6 @@ class BaseFactory(object):
_meta = FactoryOptions()
- _OLDSTYLE_ATTRIBUTES = {
- 'FACTORY_FOR': 'model',
- 'ABSTRACT_FACTORY': 'abstract',
- 'FACTORY_STRATEGY': 'strategy',
- 'FACTORY_ARG_PARAMETERS': 'inline_args',
- 'FACTORY_HIDDEN_ARGS': 'exclude',
- }
-
# ID to use for the next 'declarations.Sequence' attribute.
_counter = None