Skip to content

Commit

Permalink
Reintegrating Python 2.5 compatibility and adding Python 3.3 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmuellegger committed Feb 26, 2013
1 parent 8f414ea commit 1a53648
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 20 deletions.
3 changes: 1 addition & 2 deletions requirements/tests.txt
@@ -1,4 +1,3 @@
https://github.com/praekelt/django-setuptest/tarball/master#egg=django-setuptest
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South
South
argparse
mock
1 change: 0 additions & 1 deletion sortedm2m/__init__.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


__version__ = "0.5.0"
1 change: 0 additions & 1 deletion sortedm2m/fields.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.db import router
from django.db.models import signals
Expand Down
1 change: 0 additions & 1 deletion sortedm2m/forms.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from itertools import chain
from django import forms
Expand Down
1 change: 0 additions & 1 deletion sortedm2m_tests/models.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from sortedm2m.fields import SortedManyToManyField

Expand Down
1 change: 0 additions & 1 deletion sortedm2m_tests/sortedm2m_field/tests.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.models.fields import FieldDoesNotExist
from django.test import TestCase
from django.utils import six
Expand Down
1 change: 0 additions & 1 deletion sortedm2m_tests/sortedm2m_form/tests.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django import forms
from django.test import TestCase
from sortedm2m.forms import SortedMultipleChoiceField
Expand Down
1 change: 0 additions & 1 deletion sortedm2m_tests/south_support/models.py
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from sortedm2m.fields import SortedManyToManyField

Expand Down
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from ..models import Photo
from sortedm2m.fields import SortedManyToManyField
Expand Down
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from ..models import Photo
from sortedm2m.fields import SortedManyToManyField
Expand Down
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from ..models import Photo
from sortedm2m.fields import SortedManyToManyField
Expand Down
8 changes: 3 additions & 5 deletions sortedm2m_tests/south_support/tests.py
Expand Up @@ -9,11 +9,9 @@

if sys.version_info[0] < 3:
from StringIO import StringIO
_string_prefix = 'u'

else:
from io import StringIO
_string_prefix = ''


class SouthMigratedModelTests(TestCase):
Expand Down Expand Up @@ -81,7 +79,7 @@ def test_new_model(self):

self.assertExpectedStrings([
"Adding SortedM2M table for field new_photos on 'CompleteNewPhotoStream'",
"(%s'%s', models.IntegerField())" % (_string_prefix, SORT_VALUE_FIELD_NAME),
"('%s', models.IntegerField())" % SORT_VALUE_FIELD_NAME,
], output)

self.assertExpectedStrings([
Expand All @@ -100,7 +98,7 @@ def test_new_field(self):

self.assertExpectedStrings([
"Adding SortedM2M table for field photos on 'PhotoStream'",
"(%s'%s', models.IntegerField())" % (_string_prefix, SORT_VALUE_FIELD_NAME),
"('%s', models.IntegerField())" % SORT_VALUE_FIELD_NAME,
], output)

self.assertExpectedStrings([
Expand All @@ -119,7 +117,7 @@ def test_custom_sort_field_name(self):

self.assertExpectedStrings([
"Adding SortedM2M table for field photos on 'FeaturedPhotos'",
"(%s'featured_nr', models.IntegerField())" % _string_prefix,
"('featured_nr', models.IntegerField())",
], output)

self.assertExpectedStrings([
Expand Down
26 changes: 23 additions & 3 deletions tox.ini
Expand Up @@ -3,6 +3,7 @@ envlist =
py26-1.4, py26-1.5,
py27-1.4, py27-1.5, py27-trunk,
py32-1.5, py32-trunk,
py33-1.5, py33-trunk,
pypy-1.4, pypy-1.5, pypy-trunk,

[testenv]
Expand Down Expand Up @@ -50,13 +51,33 @@ deps =
basepython = python3.2
deps =
Django==1.5
-r{toxinidir}/requirements/tests.txt
argparse
mock
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South

[testenv:py32-trunk]
basepython = python3.2
deps =
https://github.com/django/django/tarball/master#egg=Django
-r{toxinidir}/requirements/tests.txt
argparse
mock
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South

[testenv:py33-1.5]
basepython = python3.3
deps =
Django==1.5
argparse
mock
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South

[testenv:py33-trunk]
basepython = python3.3
deps =
https://github.com/django/django/tarball/master#egg=Django
argparse
mock
https://bitbucket.org/andrewgodwin/south/get/default.tar.gz#egg=South

[testenv:pypy-1.4]
basepython = pypy
Expand All @@ -75,4 +96,3 @@ basepython = pypy
deps =
https://github.com/django/django/tarball/master#egg=Django
-r{toxinidir}/requirements/tests.txt

0 comments on commit 1a53648

Please sign in to comment.