Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
MANIFEST
build/
.tox/
*.bak
.idea
7 changes: 2 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
Django>=1.11,<2.0
Django>=2.2.9,<3.0
coverage>=3.5.2
unittest-xml-reporting>=1.3.2
dingus==0.3.4
django-migration-fixture==0.1.4
distlib==0.1.9
unittest-xml-reporting>=2.5.2
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
author = 'Bright Interactive'
author_email = 'admin@bright-interactive.co.uk'
license = 'BSD'
install_requires = ['Django>=1.11,<=2.0']
install_requires = ['Django>=2.2.9,<=3.0']


def get_version(package):
Expand Down Expand Up @@ -53,9 +53,9 @@ def get_package_data(package):
if sys.argv[-1] == 'publish':
os.system("python setup.py sdist upload")
args = {'version': get_version(package)}
print "You probably want to also tag the version now:"
print " git tag -a v%(version)s -m 'version %(version)s'" % args
print " git push --tags"
print("You probably want to also tag the version now:")
print(" git tag -a v%(version)s -m 'version %(version)s'" % args)
print(" git push --tags")
sys.exit()


Expand Down
2 changes: 1 addition & 1 deletion test_app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


from django.db import models, migrations

Expand Down
17 changes: 0 additions & 17 deletions test_app/migrations/0002_load_painters.py

This file was deleted.

4 changes: 3 additions & 1 deletion test_app/tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# (c) 2013 Bright Interactive Limited. All rights reserved.
# http://www.bright-interactive.com | info@bright-interactive.com
from django.test import TestCase, TransactionTestCase
Expand All @@ -12,6 +12,8 @@


class TestDataPreserving(DataPreservingTransactionTestCaseMixin, TransactionTestCase):
fixtures = ['painters.json']

def test_migration_data_present_in_test_1(self):
painter = Painter.objects.get(id=1)
self.assertEqual('Pablo Picasso', painter.name)
Expand Down
2 changes: 1 addition & 1 deletion test_extras/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# (c) 2012-2015 Bright Interactive Limited. All rights reserved.
# http://www.bright-interactive.com | info@bright-interactive.com

__version__ = '4.0.0'
__version__ = '5.0.0'
18 changes: 1 addition & 17 deletions test_extras/management/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# http://www.bright-interactive.com | info@bright-interactive.com

from django.conf import settings
from test_extras.testrunners import result_hook_wrap, CoverageTestSuiteWrapper, PdbTestSuiteMixin, XmlTestSuiteMixin, ProfileTestSuiteWrapper, TagTestSuiteMixin
from test_extras.testrunners import result_hook_wrap, CoverageTestSuiteWrapper, XmlTestSuiteMixin, ProfileTestSuiteWrapper, TagTestSuiteMixin
from django.core.management.commands.test import Command as CoreCommand

import argparse
Expand All @@ -17,7 +17,6 @@ class Command(CoreCommand):
except that it also adds support for:

--coverage
--pdb
--xmlreports
--profile
--tags
Expand All @@ -32,10 +31,6 @@ def add_arguments(self, parser):
dest='coverage', default=None,
choices=['text', 'html', 'xml'],
help='Coverage report; One of \'text\', \'html\', \'xml\''),
parser.add_argument(
'--pdb', action='store_true', dest='pdb',
default=False,
help='Drop into pdb on test failure.'),
parser.add_argument(
'-x', '--xmlreports', action='store_true',
dest='xmlreports', default=False,
Expand Down Expand Up @@ -86,12 +81,6 @@ def handle(self, *test_labels, **options):

TestRunner = result_hook_wrap(TestRunner)

if options['pdb'] and options['xmlreports']:
from optparse import OptionError
raise OptionError("--pdb, -x", "cannot have pdb and xmlreports specified")

if options['pdb']:
TestRunner = self.pdb_wrap(TestRunner)

if options['xmlreports']:
TestRunner = self.xml_wrap(TestRunner)
Expand Down Expand Up @@ -132,11 +121,6 @@ def __init__(self, *args, **kwargs):
super(CoverageTestSuiteRunner, self).__init__(subject, report_type, *args, **kwargs)
return CoverageTestSuiteRunner

def pdb_wrap(self, Runner):
class PdbTestSuiteRunner(PdbTestSuiteMixin, Runner):
pass
return PdbTestSuiteRunner

def xml_wrap(self, Runner):
class XmlTestSuiteRunner(XmlTestSuiteMixin, Runner):
pass
Expand Down
2 changes: 1 addition & 1 deletion test_extras/selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
have to depend on selenium.
"""

from __future__ import absolute_import


from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
Expand Down
2 changes: 1 addition & 1 deletion test_extras/testcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# (c) 2012 Bright Interactive Limited. All rights reserved.
# http://www.bright-interactive.com | info@bright-interactive.com

from StringIO import StringIO
from io import StringIO
from django.core import management
from django.core import serializers
from django.core.management import call_command
Expand Down
2 changes: 1 addition & 1 deletion test_extras/testrunners.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def get_coverage_files(app_labels, ignore_dirs, ignore_files):

for app_label in app_labels:
if app_label in settings.INSTALLED_APPS:
module = __import__(app_label, globals(), locals(), [''], -1)
module = __import__(app_label, globals(), locals(), [''], 0)
dirname = os.path.dirname(module.__file__)
files_for_coverage.extend(get_coverage_files_in_directory(dirname, ignore_dirs, ignore_files))
else:
Expand Down
2 changes: 1 addition & 1 deletion test_extras/webdriverplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}
"""

from __future__ import absolute_import


from bs4 import BeautifulSoup
from django.conf import settings
Expand Down
1 change: 0 additions & 1 deletion testsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'test_app',
'test_app_no_models',
'dotted.dotted_test_app',
'django_migration_fixture',
)

MIDDLEWARE_CLASSES = (
Expand Down
29 changes: 18 additions & 11 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
[tox]
envlist=
py27-django111,
py36-django229,py38-django329

[testenv]
commands=
python manage.py test

[base]
deps=
coverage==3.5.2
unittest-xml-reporting==1.3.2
dingus==0.3.4
distlib==0.1.9
coverage==5.0.3
unittest-xml-reporting==2.5.2

[django111]
[django229]
deps=
Django>=1.11,<2.0a0dev0
Django>=2.2.9,<3.0a0dev0
{[base]deps}
django-migration-fixture==0.1.4

[testenv:py27-django111]
basepython=python2.7
[testenv:py36-django229]
basepython=python3.6
deps=
{[django111]deps}
{[django229]deps}

[django329]
deps=
Django>=3.2.9,<4.0a0dev0
{[base]deps}

[testenv:py38-django329]
basepython=python3.8
deps=
{[django329]deps}