mirror of
https://github.com/QingdaoU/Spirit.git
synced 2024-12-28 15:32:12 +00:00
Feature/support django 1 10 (#139)
* topic.poll fix test * update requirements * travis test env django 1.8, 1.9 and 1.10 * readme add django 1.10 * history add support django 1.10 * coveragerc omit migrations runtests and setup
This commit is contained in:
parent
868250526a
commit
4c8fbac155
6
.coveragerc
Normal file
6
.coveragerc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[report]
|
||||||
|
omit =
|
||||||
|
runtests.py
|
||||||
|
setup.py
|
||||||
|
*/migrations/*
|
||||||
|
*settings*
|
@ -7,10 +7,14 @@ python:
|
|||||||
- "2.7"
|
- "2.7"
|
||||||
- "3.4"
|
- "3.4"
|
||||||
- "3.5"
|
- "3.5"
|
||||||
|
env:
|
||||||
|
- DJANGO=1.8.16
|
||||||
|
- DJANGO=1.9.11
|
||||||
|
- DJANGO=1.10.3
|
||||||
install:
|
install:
|
||||||
- pip install --upgrade pip
|
- pip install --upgrade pip
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
|
- pip install -q Django==$DJANGO
|
||||||
- pip install coveralls pep8==1.5.7 flake8
|
- pip install coveralls pep8==1.5.7 flake8
|
||||||
script:
|
script:
|
||||||
- flake8 --exit-zero
|
- flake8 --exit-zero
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
* Drops support for Python 3.3
|
* Drops support for Python 3.3
|
||||||
* Adds support for Django 1.9
|
* Adds support for Django 1.9 and 1.10
|
||||||
|
|
||||||
0.4.8
|
0.4.8
|
||||||
==================
|
==================
|
||||||
|
@ -12,7 +12,7 @@ To see it in action, please visit [The Spirit Project](http://spirit-project.com
|
|||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
* Python 2.7, 3.4 and 3.5 (recommended)
|
* Python 2.7, 3.4 and 3.5 (recommended)
|
||||||
* Django 1.8 LTS (recommended) and 1.9
|
* Django 1.8 LTS (recommended), 1.9 and 1.10
|
||||||
* PostgreSQL (recommended), MySQL, Oracle Database and SQLite
|
* PostgreSQL (recommended), MySQL, Oracle Database and SQLite
|
||||||
|
|
||||||
## Installing (Advanced)
|
## Installing (Advanced)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
Django>=1.8,<1.10
|
Django>=1.8,<1.11
|
||||||
django-haystack==2.5.0
|
django-haystack==2.5.1
|
||||||
whoosh==2.7.0
|
whoosh==2.7.0
|
||||||
mistune==0.7.1
|
mistune==0.7.1
|
||||||
Pillow==3.1.0
|
Pillow==3.1.0
|
||||||
django-infinite-scroll-pagination>=0.1.3,<0.2
|
django-infinite-scroll-pagination>=0.2.0,<0.3
|
||||||
django-djconfig>=0.5.0,<0.6
|
django-djconfig>=0.5.1,<0.6
|
||||||
unicode-slugify==0.1.3
|
unicode-slugify==0.1.3
|
||||||
pytz
|
pytz
|
||||||
|
@ -6,6 +6,7 @@ from django.test import TestCase
|
|||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.template import Template, Context
|
from django.template import Template, Context
|
||||||
|
from django.contrib.auth.models import AnonymousUser
|
||||||
|
|
||||||
from ...core.tests import utils
|
from ...core.tests import utils
|
||||||
from .models import TopicPoll, TopicPollChoice, TopicPollVote
|
from .models import TopicPoll, TopicPollChoice, TopicPollVote
|
||||||
@ -478,10 +479,8 @@ class TopicPollTemplateTagsTest(TestCase):
|
|||||||
poll_choice = TopicPollChoice.objects.create(poll=self.poll, description="op2")
|
poll_choice = TopicPollChoice.objects.create(poll=self.poll, description="op2")
|
||||||
TopicPollVote.objects.create(user=self.user, choice=poll_choice)
|
TopicPollVote.objects.create(user=self.user, choice=poll_choice)
|
||||||
|
|
||||||
self.user.is_authenticated = lambda: True
|
|
||||||
context = render_poll_form(self.topic, self.user)
|
context = render_poll_form(self.topic, self.user)
|
||||||
self.assertDictEqual(context['form'].initial, {'choices': poll_choice})
|
self.assertDictEqual(context['form'].initial, {'choices': poll_choice})
|
||||||
|
|
||||||
self.user.is_authenticated = lambda: False
|
context = render_poll_form(self.topic, AnonymousUser())
|
||||||
context = render_poll_form(self.topic, self.user)
|
|
||||||
self.assertDictEqual(context['form'].initial, {})
|
self.assertDictEqual(context['form'].initial, {})
|
||||||
|
Loading…
Reference in New Issue
Block a user