Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #57 from cmc333333/django19
Browse files Browse the repository at this point in the history
Add Django 1.9 support
  • Loading branch information
khandelwal authored Jun 21, 2016
2 parents 65a58d0 + 48905b5 commit 8284953
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ language: python
sudo: false
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
# - "3.2" pyelasticsearch is not compatible
# - "3.3" Django stopped supporting this in 1.9
# - "pypy3" requires sudo in travis
install:
- pip install -r requirements.txt
Expand Down
5 changes: 5 additions & 0 deletions regcore/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
}
}

TEMPLATES = [{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'APP_DIRS': True,
}]

TEST_RUNNER = 'django_nose.runner.NoseTestSuiteRunner'

ROOT_URLCONF = 'regcore.urls'
Expand Down
6 changes: 2 additions & 4 deletions regcore/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from collections import defaultdict

from django.conf import settings
from django.conf.urls import patterns

from regcore_read.views import (
diff as rdiff, layer as rlayer, notice as rnotice,
Expand Down Expand Up @@ -47,8 +46,7 @@ def seg(label):
return r'(?P<%s>[-\w]+)' % label


urlpatterns = patterns(
'',
urlpatterns = [
by_verb_url(r'^diff/%s/%s/%s$' % (seg('label_id'), seg('old_version'),
seg('new_version')),
'diff', mapping['diff']),
Expand All @@ -72,4 +70,4 @@ def seg(label):
kwargs={'doc_type': 'cfr'}),
by_verb_url(r'^search/preamble$', 'search', mapping['search'],
kwargs={'doc_type': 'preamble'}),
)
]
7 changes: 3 additions & 4 deletions regcore_read/tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from django.conf.urls import patterns, url
from django.conf.urls import url

from regcore_read.views import es_search, haystack_search


urlpatterns = patterns(
'',
urlpatterns = [
url(r'^es_search$', es_search.search, kwargs={'doc_type': 'cfr'}),
url(
r'^haystack_search$',
haystack_search.search,
kwargs={'doc_type': 'cfr'},
),
)
]
5 changes: 2 additions & 3 deletions regcore_read/tests/views_es_search_tests.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from django.test import TestCase
from django.test import override_settings, TestCase
from django.test.client import Client
from mock import patch
from regcore_read.views.es_search import transform_results


@override_settings(ROOT_URLCONF='regcore_read.tests.urls')
class ViewsESSearchTest(TestCase):
urls = 'regcore_read.tests.urls'

def test_search_missing_q(self):
response = Client().get('/es_search?non_q=test')
self.assertEqual(400, response.status_code)
Expand Down
5 changes: 2 additions & 3 deletions regcore_read/tests/views_haystack_search_tests.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from collections import namedtuple

from django.test import TestCase
from django.test import override_settings, TestCase
from django.test.client import Client
from mock import patch

from regcore_read.views.haystack_search import transform_results


@override_settings(ROOT_URLCONF='regcore_read.tests.urls')
class ViewsHaystackSearchTest(TestCase):
urls = 'regcore_read.tests.urls'

def test_search_missing_q(self):
response = Client().get('/haystack_search?non_q=test')
self.assertEqual(400, response.status_code)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
license="public domain",
packages=find_packages(),
install_requires=[
'django>=1.8,<1.9',
'django>=1.8,<1.10',
'django-mptt',
'jsonschema',
'six',
Expand Down

0 comments on commit 8284953

Please sign in to comment.