From f582c20e44989f01c40228941d8c0b6cdd0779a0 Mon Sep 17 00:00:00 2001 From: jahan01 Date: Sun, 7 Feb 2016 17:52:32 +0800 Subject: [PATCH] added python3 and django1.9 tests in travis build --- .travis.yml | 7 ++++++- setup.py | 4 +--- tests/testproject/testapp/tests.py | 2 +- tests/testproject/testapp/views.py | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48fa9d1..4418cfb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,14 @@ language: python services: sqlite env: - - DJANGO='django==1.8' + - DJANGO='django>=1.8,<1.9' + - DJANGO='django>=1.9,<1.10' python: - 2.7 + - 3.2 + - 3.3 + - 3.4 + - 3.5 install: - pip install $DJANGO - python setup.py install diff --git a/setup.py b/setup.py index e428368..f1b6ff6 100644 --- a/setup.py +++ b/setup.py @@ -24,17 +24,15 @@ def readme(): "Environment :: Web Environment", "Environment :: Plugins", "Development Status :: 5 - Production/Stable", - "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Framework :: Django", - "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities", ], -) \ No newline at end of file +) diff --git a/tests/testproject/testapp/tests.py b/tests/testproject/testapp/tests.py index 384fb4b..274c9af 100644 --- a/tests/testproject/testapp/tests.py +++ b/tests/testproject/testapp/tests.py @@ -141,7 +141,7 @@ def setUp(self): def check(self, param, prev, next): request_url = self.view_url + param response = self.client.get(request_url) - self.assertContains(response, "Page dict: {'prev': '%s', 'next': '%s'}" % (prev, next)) + self.assertEqual(response.content.decode("utf-8"), "Page dict:- next:%s, prev:%s" % (next, prev)) def check_not_found(self, param): request_url = self.view_url + param diff --git a/tests/testproject/testapp/views.py b/tests/testproject/testapp/views.py index a9fb64d..a823883 100644 --- a/tests/testproject/testapp/views.py +++ b/tests/testproject/testapp/views.py @@ -59,4 +59,4 @@ class PaginatedView(PaginationMixin, ListView): def get(self, request, *args, **kwargs): listview = super(PaginatedView, self).get(request, *args, **kwargs) page_dict = listview.context_data['page_dict'] - return HttpResponse("Page dict: %s" % page_dict) + return HttpResponse("Page dict:- next:%s, prev:%s" % (page_dict['next'], page_dict['prev']))