improvements to coverage, and added pypy3 testing

This commit is contained in:
Ken Cochrane 2015-01-01 13:50:19 -05:00
parent 98f3a3c776
commit aa934d7af4
4 changed files with 10 additions and 10 deletions

View file

@ -7,6 +7,7 @@ python:
- "3.3"
- "3.4"
- "pypy"
- "pypy3"
env:
- DJANGO=Django==1.4.16

View file

@ -75,7 +75,7 @@ requirements
- django: 1.4.x, 1.6.x, 1.7.x
- redis
- python: 2.6.x, 2.7.x, 3.2.x, 3.3.x, 3.4.x, PyPy, PyPy3
How it works
============

View file

@ -2,7 +2,7 @@ import redis
try:
import urlparse
except ImportError:
import urllib.parse as urlparse
import urllib.parse as urlparse # pragma: no cover
from . import config

View file

@ -9,22 +9,21 @@ from django.test import TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import NoReverseMatch
from django.core.urlresolvers import reverse
from django.conf import settings
from .connection import parse_redis_url
from . import utils
from . import config
if config.MOCK_REDIS:
redis_client = mockredis.mock_strict_redis_client()
else:
from .connection import get_redis_connection
redis_client = get_redis_connection()
if config.MOCK_REDIS: # pragma: no cover
redis_client = mockredis.mock_strict_redis_client() # pragma: no cover
else: # pragma: no cover
from .connection import get_redis_connection # pragma: no cover
redis_client = get_redis_connection() # pragma: no cover
# Django >= 1.7 compatibility
try:
ADMIN_LOGIN_URL = reverse('admin:login')
LOGIN_FORM_KEY = '<form action="/admin/" method="post" id="login-form">'
ADMIN_LOGIN_URL = reverse('admin:login')
except NoReverseMatch:
ADMIN_LOGIN_URL = reverse('admin:index')
LOGIN_FORM_KEY = 'this_is_the_login_form'
@ -128,7 +127,7 @@ class AccessAttemptTest(TestCase):
if config.MOCK_REDIS:
# mock redis require that we expire on our own
redis_client.do_expire()
redis_client.do_expire() # pragma: no cover
# It should be possible to login again, make sure it is.
self.test_valid_login()