Skip to content

Commit

Permalink
Fix tests. Integrate Django 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Nov 8, 2013
1 parent f64f697 commit a0d6468
Show file tree
Hide file tree
Showing 7 changed files with 2,888 additions and 12 deletions.
2 changes: 1 addition & 1 deletion adrest/api.py
Expand Up @@ -56,7 +56,7 @@ class SomeResource():
"""
import logging

from django.conf.urls.defaults import patterns
from django.conf.urls import patterns
from django.dispatch import Signal
from django.http import HttpRequest

Expand Down
2 changes: 1 addition & 1 deletion adrest/views.py
@@ -1,6 +1,6 @@
""" Base request resource. """

from django.conf.urls.defaults import url
from django.conf.urls import url
from django.core.exceptions import ValidationError
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
Expand Down
2,847 changes: 2,847 additions & 0 deletions runtests.py

Large diffs are not rendered by default.

22 changes: 19 additions & 3 deletions setup.py
@@ -1,7 +1,7 @@
""" Setup ADRest. """
import os

from setuptools import setup, find_packages
from setuptools import setup, find_packages, Command

from adrest import version, PROJECT, LICENSE

Expand All @@ -22,6 +22,22 @@ def __read(fname):

install_requires = __read('requirements.txt').split()


class PyTest(Command):

user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
import sys,subprocess
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)

setup(
author_email='horneds@gmail.com',
author='Kirill Klenov',
Expand All @@ -34,8 +50,8 @@ def __read(fname):
packages=find_packages(),
platforms=('Any'),
keywords='rest rpc api django'.split(),
tests_require=['pymongo', 'mixer'],
test_suite='tests.test_adrest',
tests_require=['pytest', 'pymongo', 'mixer'],
cmdclass={ 'test': PyTest },
url=' http://github.com/klen/{0}'.format(PROJECT),
version=version,
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion tests/core/tests/handler.py
Expand Up @@ -111,7 +111,7 @@ def dispatch(self, request, **resources):
self.assertTrue(pirate in response.resources)

def test_resources(self):
pirates = mixer.cycle(2).blend('pirate', character='evil')
pirates = mixer.cycle(2).blend('core.pirate', character='evil')
response = self.put_resource(
'pirate', data=dict(
pirate=[p.pk for p in pirates],
Expand Down
2 changes: 1 addition & 1 deletion tests/core/urls.py
@@ -1,5 +1,5 @@
""" Collect URLS from apps. """
from django.conf.urls.defaults import include, patterns
from django.conf.urls import include, patterns

from ..main.api import API as main
from ..main.resources import DummyResource
Expand Down
23 changes: 18 additions & 5 deletions tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist=py26-14,py27-14,py26-15,py27-15,cov
envlist=py26-14,py27-14,py26-15,py27-15,py26-16,py27-16,cov
; envlist=py26-14,py27-14,py26-15,py27-15,py33-15,cow

[pytest]
Expand All @@ -17,26 +17,39 @@ deps =
basepython = python2.6
deps =
ordereddict==1.1
django==1.4.5
django==1.4.10
{[testenv]deps}

[testenv:py27-14]
basepython = python2.7
deps =
django==1.4.5
django==1.4.10
{[testenv]deps}

[testenv:py26-15]
basepython = python2.6
deps =
ordereddict==1.1
django==1.5.1
django==1.5.5
{[testenv]deps}

[testenv:py27-15]
basepython = python2.7
deps =
django==1.5.1
django==1.5.5
{[testenv]deps}

[testenv:py26-16]
basepython = python2.6
deps =
ordereddict==1.1
django==1.6
{[testenv]deps}

[testenv:py27-16]
basepython = python2.7
deps =
django==1.6
{[testenv]deps}

[testenv:py33-15]
Expand Down

0 comments on commit a0d6468

Please sign in to comment.