summaryrefslogtreecommitdiff
path: root/factory/compat.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2013-06-27 01:19:24 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2013-06-27 01:19:24 +0200
commit168ef54e5acfac59f7c625e75a0c7c6d2484cdf0 (patch)
tree30649368a7fe6db8f1c3c965f598a17ac23a495a /factory/compat.py
parent77807b4a6bbec59ea98c9f53557ac96239c6300e (diff)
downloadfactory-boy-168ef54e5acfac59f7c625e75a0c7c6d2484cdf0.tar
factory-boy-168ef54e5acfac59f7c625e75a0c7c6d2484cdf0.tar.gz
Add factory.django.ImageField (Closes #52).
Diffstat (limited to 'factory/compat.py')
-rw-r--r--factory/compat.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/factory/compat.py b/factory/compat.py
index 7c9b845..f77458f 100644
--- a/factory/compat.py
+++ b/factory/compat.py
@@ -31,10 +31,15 @@ PY2 = (sys.version_info[0] == 2)
if PY2: # pragma: no cover
def is_string(obj):
return isinstance(obj, (str, unicode))
+
+ from StringIO import StringIO as BytesIO
+
else: # pragma: no cover
def is_string(obj):
return isinstance(obj, str)
+ from io import BytesIO
+
try: # pragma: no cover
# Python >= 3.2
UTC = datetime.timezone.utc