Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtests is broken in Django 1.8 #45

Closed
chrisdev opened this issue Apr 14, 2015 · 8 comments
Closed

runtests is broken in Django 1.8 #45

chrisdev opened this issue Apr 14, 2015 · 8 comments

Comments

@chrisdev
Copy link
Owner

django.test.simple was removed in 1.8

@chrisdev chrisdev changed the title runtest is broken in Django 1.8 runtests is broken in Django 1.8 Apr 14, 2015
@Parbhat
Copy link
Contributor

Parbhat commented May 6, 2015

@chrisdev To Upgrade to Django 1.8 we have to do two steps -

  • The module django.test.simple and the class django.test.simple.DjangoTestSuiteRunner are removed in django 1.8 so we have to use django.test.runner.DiscoverRunner

The code to be change in runtests.py as

def runtests(*test_args):
   if not test_args:
        test_args = ['django_pandas']

   parent = os.path.dirname(os.path.abspath(__file__))
   sys.path.insert(0, parent)

   if django.VERSION < (1, 8):
      from django.test.simple import DjangoTestSuiteRunner
      failures = DjangoTestSuiteRunner(
      verbosity=1, interactive=True, failfast=False).run_tests(['tests'])
      sys.exit(failures)

   else:
      from django.test.runner import DiscoverRunner
      failures = DiscoverRunner(
        verbosity=1, interactive=True, failfast=False).run_tests(test_args)
      sys.exit(failures)

django.test.runner.DiscoverRunner is introduced only in Django 1.6 so we have to check for version.
This works and remove the existing error ImportError: No module named 'django.test.simple'

  • The Tests now run fine in Django 1.7.x but in Django 1.8, some tests fail with attribute errors which can be fixed by making tests files compatible with django 1.8

@chrisdev
Copy link
Owner Author

chrisdev commented May 6, 2015

Ok Is this all that is blocking 1.8 compatibility?
If this is the case maybe you can do a pull request?
Well done @Parbhat

@Parbhat
Copy link
Contributor

Parbhat commented May 6, 2015

yes @chrisdev

@Parbhat
Copy link
Contributor

Parbhat commented May 7, 2015

@chrisdev only one error is left specific to django 1.8, working to solve it

@chrisdev
Copy link
Owner Author

chrisdev commented Jun 9, 2015

@Parbhat this error is a consequence of https://code.djangoproject.com/ticket/24211
qs.aggregate_names changed to qs.annotation_names
ValuesQuerySet() and ValuesListQuerySet() have been replaced by ValuesIterator

@Parbhat
Copy link
Contributor

Parbhat commented Jun 9, 2015

@chrisdev Great so now django-pandas can be upgraded to 1.8

chrisdev added a commit that referenced this issue Jun 9, 2015
@chrisdev
Copy link
Owner Author

Test are failing because our travis.cl and fox config sucks. We've got to update and modernise

@chrisdev
Copy link
Owner Author

Created a issue #50 to create a better travis/tox config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants