Skip to content

Commit 90f0e18

Browse files
committed
fixed django 1.5c2 tests
1 parent cf7e9f1 commit 90f0e18

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ env:
99
- DJANGO="Django==1.4.3" DBENGINE=sqlite
1010
- DJANGO="Django==1.4.3" DBENGINE=mysql
1111
- DJANGO="Django==1.4.3" DBENGINE=pg
12-
- DJANGO=https://www.djangoproject.com/download/1.5c1/tarball/ DBENGINE=mysql
13-
- DJANGO=https://www.djangoproject.com/download/1.5c1/tarball/ DBENGINE=pg
14-
- DJANGO=https://www.djangoproject.com/download/1.5c1/tarball/ DBENGINE=sqlite
12+
- DJANGO=https://www.djangoproject.com/download/1.5c2/tarball/ DBENGINE=mysql
13+
- DJANGO=https://www.djangoproject.com/download/1.5c2/tarball/ DBENGINE=pg
14+
- DJANGO=https://www.djangoproject.com/download/1.5c2/tarball/ DBENGINE=sqlite
1515
install:
1616
- sh -c "if [ '$DBENGINE' = 'pg' ]; then pip install -q psycopg2; fi"
1717
- sh -c "if [ '$DBENGINE' = 'mysql' ]; then pip install -q MySQL-python; fi"

concurrency/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import datetime
33
import os
44

5-
VERSION = __version__ = (0, 4, 0, 'rc', 4)
5+
VERSION = __version__ = (0, 4, 0, 'rc', 5)
66
__author__ = 'sax'
77

88

concurrency/tests/contrib_admin.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import re
2-
from django.contrib import admin
32
import os
4-
3+
import django.core.management
4+
from django.contrib import admin
55
from django.conf import global_settings
66
from django.contrib.auth.models import User
7-
import django.core.management
87
from django.core.urlresolvers import reverse
98
from django.forms.models import modelform_factory
109
from django.test import TestCase
@@ -125,14 +124,13 @@ def test_conflict(self):
125124
url = reverse('admin:concurrency_testmodel1_change', args=[self.target1.pk])
126125
response = self.client.get(url)
127126
self.assertIn('original', response.context, response)
128-
# form = response.context['adminform'].form
129-
rex = re.compile(r'name="version" value="(\d*):(.[^"]*)"')
127+
rex = re.compile(r'name="version" .*value="(\d*):(.[^"]*)"')
130128
m = rex.search(str(response), re.M + re.I)
131129
assert m.group(1) == str(response.context['original'].version)
130+
132131
data = {'username': u'new_username',
133132
'last_name': None,
134133
'version': VersionFieldSigner().sign(m.group(1)),
135-
# 'version': response.context['adminform'].form['version'].value(),
136134
'char_field': None,
137135
'_continue': 1,
138136
'date_field': '2010-09-01'}
@@ -151,7 +149,7 @@ def test_sanity_signer(self):
151149
url = reverse('admin:concurrency_testmodel1_change', args=[self.target1.pk])
152150
response = self.client.get(url)
153151
self.assertIn('original', response.context, response)
154-
rex = re.compile(r'name="version" value="(\d*):(.[^"]*)"')
152+
rex = re.compile(r'name="version" .*value="(\d*):(.[^"]*)"')
155153

156154
m1 = rex.search(str(response), re.M + re.I)
157155
assert m1.group(1) == str(response.context['original'].version)

tox.ini

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
[tox]
22
envlist =
3-
py27_django14
3+
dj14, dj15
44

55
[testenv]
66
changedir=tests
77
commands =
88
django-admin.py test --settings concurren
99

10+
setenv =
11+
PYTHONPATH = /data/VENV/testing//data/VENV/LIB/django/$DJANGOVERSION:$PYTHONPATH:
12+
1013

11-
[testenv:py27_django14]
14+
[testenv:dj14]
1215
basepython = python2.7
1316
setenv =
1417
DJANGOVERSION = 1.4.3
1518
deps =
1619
-r{toxinidir}/requirements.pip
20+
21+
[testenv:dj15]
22+
basepython = python2.7
23+
setenv =
24+
DJANGOVERSION = 1.5c2
25+
deps =
26+
-r{toxinidir}/requirements.pip

0 commit comments

Comments
 (0)