Skip to content

Commit 8a1a23e

Browse files
authored
Merge pull request #276 from rooterkyberian/more_testenvs
added py36 and Django 1.11 to test environments
2 parents c7fdfec + 909de03 commit 8a1a23e

File tree

8 files changed

+68
-21
lines changed

8 files changed

+68
-21
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ python:
77
- 3.3
88
- 3.4
99
- 3.5
10+
- 3.6
1011

1112
env:
1213
- DJANGO="Django>=1.6,<1.7"
1314
- DJANGO="Django>=1.7,<1.8"
1415
- DJANGO="Django>=1.8,<1.9"
1516
- DJANGO="Django>=1.9,<1.10"
1617
- DJANGO="Django>=1.10,<1.11"
18+
- DJANGO="Django>=1.11,<1.12"
1719

1820
install:
1921
- pip install -U coverage codecov
@@ -30,9 +32,15 @@ matrix:
3032
env: DJANGO="Django>=1.6,<1.7"
3133
- python: 3.5
3234
env: DJANGO="Django>=1.7,<1.8"
35+
- python: 3.6
36+
env: DJANGO="Django>=1.6,<1.7"
37+
- python: 3.6
38+
env: DJANGO="Django>=1.7,<1.8"
3339
- python: 3.3
3440
env: DJANGO="Django>=1.9,<1.10"
3541
- python: 3.3
3642
env: DJANGO="Django>=1.10,<1.11"
43+
- python: 3.3
44+
env: DJANGO="Django>=1.11,<1.12"
3745

3846
after_success: codecov

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Authors
2222
- Jonathan Sanchez
2323
- Josh Fyne
2424
- Klaas van Schelven
25+
- Maciej "RooTer" Urbański
2526
- Martin Bachwerk
2627
- Marty Alchin
2728
- Mauricio de Abreu Antunes

runtests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
]
2828

2929
DEFAULT_SETTINGS = dict(
30+
ALLOWED_HOSTS=['localhost'],
3031
AUTH_USER_MODEL='custom_user.CustomUser',
3132
ROOT_URLCONF='simple_history.tests.urls',
3233
MEDIA_ROOT=media_root,
@@ -45,6 +46,11 @@
4546
TEMPLATES=[{
4647
'BACKEND': 'django.template.backends.django.DjangoTemplates',
4748
'APP_DIRS': True,
49+
'OPTIONS': {
50+
'context_processors': [
51+
'django.contrib.auth.context_processors.auth',
52+
]
53+
},
4854
}],
4955
)
5056

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
'Programming Language :: Python :: 3.2',
3131
'Programming Language :: Python :: 3.3',
3232
'Programming Language :: Python :: 3.4',
33+
'Programming Language :: Python :: 3.5',
34+
'Programming Language :: Python :: 3.6',
3335
"License :: OSI Approved :: BSD License",
3436
],
3537
tests_require=tests_require,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import unicode_literals
2+
3+
from django.contrib import admin
4+
from django.contrib.auth.admin import UserAdmin
5+
6+
from .models import CustomUser
7+
8+
admin.site.register(CustomUser, UserAdmin)
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
from __future__ import unicode_literals
2-
from django.contrib import admin
3-
from django.contrib.auth.admin import UserAdmin
42

53
from django.contrib.auth.models import AbstractUser
64

75

86
class CustomUser(AbstractUser):
97
pass
10-
11-
admin.site.register(CustomUser, UserAdmin)

simple_history/tests/models.py

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,20 @@ def _history_date(self):
4444

4545

4646
class Choice(models.Model):
47-
poll = models.ForeignKey(Poll)
47+
poll = models.ForeignKey(Poll, on_delete=models.CASCADE)
4848
choice = models.CharField(max_length=200)
4949
votes = models.IntegerField()
5050

5151
register(Choice)
5252

5353

5454
class Voter(models.Model):
55-
user = models.ForeignKey(User)
56-
choice = models.ForeignKey(Choice, related_name='voters')
55+
user = models.ForeignKey(User, on_delete=models.CASCADE)
56+
choice = models.ForeignKey(
57+
Choice,
58+
on_delete=models.CASCADE,
59+
related_name='voters',
60+
)
5761

5862

5963
class HistoricalRecordsVerbose(HistoricalRecords):
@@ -98,7 +102,11 @@ class FileModel(models.Model):
98102

99103

100104
class Document(models.Model):
101-
changed_by = models.ForeignKey(User, null=True, blank=True)
105+
changed_by = models.ForeignKey(
106+
User,
107+
on_delete=models.CASCADE,
108+
null=True, blank=True,
109+
)
102110
history = HistoricalRecords()
103111

104112
@property
@@ -119,11 +127,11 @@ class Profile(User):
119127

120128

121129
class AdminProfile(models.Model):
122-
profile = models.ForeignKey(Profile)
130+
profile = models.ForeignKey(Profile, on_delete=models.CASCADE)
123131

124132

125133
class State(models.Model):
126-
library = models.ForeignKey('Library', null=True)
134+
library = models.ForeignKey('Library', on_delete=models.CASCADE, null=True)
127135
history = HistoricalRecords()
128136

129137

@@ -137,11 +145,11 @@ class HardbackBook(Book):
137145

138146

139147
class Bookcase(models.Model):
140-
books = models.ForeignKey(HardbackBook)
148+
books = models.ForeignKey(HardbackBook, on_delete=models.CASCADE)
141149

142150

143151
class Library(models.Model):
144-
book = models.ForeignKey(Book, null=True)
152+
book = models.ForeignKey(Book, on_delete=models.CASCADE, null=True)
145153
history = HistoricalRecords()
146154

147155
class Meta:
@@ -177,11 +185,11 @@ class ConcreteUtil(AbstractBase):
177185

178186

179187
class MultiOneToOne(models.Model):
180-
fk = models.ForeignKey(SecondLevelInheritedModel)
188+
fk = models.ForeignKey(SecondLevelInheritedModel, on_delete=models.CASCADE)
181189

182190

183191
class SelfFK(models.Model):
184-
fk = models.ForeignKey('self', null=True)
192+
fk = models.ForeignKey('self', on_delete=models.CASCADE, null=True)
185193
history = HistoricalRecords()
186194

187195

@@ -212,7 +220,7 @@ class Meta:
212220

213221

214222
class CustomFKError(models.Model):
215-
fk = models.ForeignKey(SecondLevelInheritedModel)
223+
fk = models.ForeignKey(SecondLevelInheritedModel, on_delete=models.CASCADE)
216224
history = HistoricalRecords()
217225

218226

@@ -223,7 +231,11 @@ class Series(models.Model):
223231

224232

225233
class SeriesWork(models.Model):
226-
series = models.ForeignKey('Series', related_name='works')
234+
series = models.ForeignKey(
235+
'Series',
236+
on_delete=models.CASCADE,
237+
related_name='works',
238+
)
227239
title = models.CharField(max_length=100)
228240
history = HistoricalRecords()
229241

@@ -232,7 +244,11 @@ class Meta:
232244

233245

234246
class PollInfo(models.Model):
235-
poll = models.ForeignKey(Poll, primary_key=True)
247+
poll = models.ForeignKey(
248+
Poll,
249+
on_delete=models.CASCADE,
250+
primary_key=True,
251+
)
236252
history = HistoricalRecords()
237253

238254

@@ -254,12 +270,20 @@ class Country(models.Model):
254270

255271

256272
class Province(models.Model):
257-
country = models.ForeignKey(Country, to_field='code')
273+
country = models.ForeignKey(
274+
Country,
275+
on_delete=models.CASCADE,
276+
to_field='code',
277+
)
258278
history = HistoricalRecords()
259279

260280

261281
class City(models.Model):
262-
country = models.ForeignKey(Country, db_column='countryCode')
282+
country = models.ForeignKey(
283+
Country,
284+
on_delete=models.CASCADE,
285+
db_column='countryCode',
286+
)
263287
history = HistoricalRecords()
264288

265289

tox.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ envlist =
44
py{27,33,34}-django17,
55
py{27,33,34,35}-django18,
66
py{27,34,35}-django19,
7-
py{27,34,35}-django110,
8-
py{27,34,35}-djangotrunk,
7+
py{27,34,35,36}-django110,
8+
py{27,34,35,36}-django111,
9+
py{35,36}-djangotrunk,
910
docs, flake8
1011

1112

@@ -35,6 +36,7 @@ deps =
3536
django18: Django>=1.8,<1.9
3637
django19: Django>=1.9,<1.10
3738
django110: Django>=1.10,<1.11
39+
django111: Django>=1.11,<1.12
3840
djangotrunk: https://github.com/django/django/tarball/master
3941
commands =
4042
coverage run -a --branch setup.py test

0 commit comments

Comments
 (0)