aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2012-08-17 17:02:48 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2012-11-15 00:01:23 +0100
commitb093cc6a35c884b926e0c2bc5928b330cccd4e03 (patch)
treecb58e88dffa693a505b4b3f54d18f0714350a973
parent9db320ba65d91ff8c09169b359ded4bfff5196db (diff)
downloadfactory-boy-b093cc6a35c884b926e0c2bc5928b330cccd4e03.tar
factory-boy-b093cc6a35c884b926e0c2bc5928b330cccd4e03.tar.gz
[py3] Remove calls to iteritems().
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
-rw-r--r--factory/base.py2
-rw-r--r--factory/containers.py4
-rw-r--r--tests/test_base.py2
-rw-r--r--tests/test_using.py14
4 files changed, 11 insertions, 11 deletions
diff --git a/factory/base.py b/factory/base.py
index a3d91b0..240170c 100644
--- a/factory/base.py
+++ b/factory/base.py
@@ -396,7 +396,7 @@ class BaseFactory(object):
factory's declarations or in the extra kwargs.
"""
stub_object = containers.StubObject()
- for name, value in cls.attributes(create=False, extra=kwargs).iteritems():
+ for name, value in cls.attributes(create=False, extra=kwargs).items():
setattr(stub_object, name, value)
return stub_object
diff --git a/factory/containers.py b/factory/containers.py
index d50cb71..46a647f 100644
--- a/factory/containers.py
+++ b/factory/containers.py
@@ -136,7 +136,7 @@ class DeclarationDict(dict):
Returns a dict containing all remaining elements.
"""
remaining = {}
- for k, v in d.iteritems():
+ for k, v in d.items():
if self.is_declaration(k, v):
self[k] = v
else:
@@ -262,7 +262,7 @@ class AttributeBuilder(object):
# Parse attribute declarations, wrapping SubFactory and
# OrderedDeclaration.
wrapped_attrs = {}
- for k, v in self._attrs.iteritems():
+ for k, v in self._attrs.items():
if isinstance(v, declarations.SubFactory):
v = SubFactoryWrapper(v, self._subfields.get(k, {}), create)
elif isinstance(v, declarations.OrderedDeclaration):
diff --git a/tests/test_base.py b/tests/test_base.py
index 7ec3d0e..c8109db 100644
--- a/tests/test_base.py
+++ b/tests/test_base.py
@@ -42,7 +42,7 @@ class FakeDjangoModel(object):
return instance
def __init__(self, **kwargs):
- for name, value in kwargs.iteritems():
+ for name, value in kwargs.items():
setattr(self, name, value)
self.id = None
diff --git a/tests/test_using.py b/tests/test_using.py
index 7e141eb..7cebacb 100644
--- a/tests/test_using.py
+++ b/tests/test_using.py
@@ -56,7 +56,7 @@ class FakeModel(object):
objects = FakeModelManager()
def __init__(self, **kwargs):
- for name, value in kwargs.iteritems():
+ for name, value in kwargs.items():
setattr(self, name, value)
self.id = None
@@ -763,7 +763,7 @@ class SubFactoryTestCase(unittest.TestCase):
def testSubFactoryAndSequence(self):
class TestObject(object):
def __init__(self, **kwargs):
- for k, v in kwargs.iteritems():
+ for k, v in kwargs.items():
setattr(self, k, v)
class TestObjectFactory(factory.Factory):
@@ -784,7 +784,7 @@ class SubFactoryTestCase(unittest.TestCase):
def testSubFactoryOverriding(self):
class TestObject(object):
def __init__(self, **kwargs):
- for k, v in kwargs.iteritems():
+ for k, v in kwargs.items():
setattr(self, k, v)
class TestObjectFactory(factory.Factory):
@@ -793,7 +793,7 @@ class SubFactoryTestCase(unittest.TestCase):
class OtherTestObject(object):
def __init__(self, **kwargs):
- for k, v in kwargs.iteritems():
+ for k, v in kwargs.items():
setattr(self, k, v)
class WrappingTestObjectFactory(factory.Factory):
@@ -813,7 +813,7 @@ class SubFactoryTestCase(unittest.TestCase):
class TestObject(object):
def __init__(self, **kwargs):
- for k, v in kwargs.iteritems():
+ for k, v in kwargs.items():
setattr(self, k, v)
class TestObjectFactory(factory.Factory):
@@ -839,7 +839,7 @@ class SubFactoryTestCase(unittest.TestCase):
class TestObject(object):
def __init__(self, **kwargs):
- for k, v in kwargs.iteritems():
+ for k, v in kwargs.items():
setattr(self, k, v)
class TestObjectFactory(factory.Factory):
@@ -866,7 +866,7 @@ class SubFactoryTestCase(unittest.TestCase):
"""Test inheriting from a factory with subfactories, overriding."""
class TestObject(object):
def __init__(self, **kwargs):
- for k, v in kwargs.iteritems():
+ for k, v in kwargs.items():
setattr(self, k, v)
class TestObjectFactory(factory.Factory):