Skip to content

Commit

Permalink
Fixed tests for Django 1.11.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
illagrenan committed Apr 5, 2017
1 parent dcd1931 commit d1dc61d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 4 additions & 1 deletion tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# ! python3

import gzip
from typing import Mapping, Optional
from unittest import TestCase

import brotli
from django.middleware.gzip import GZipMiddleware
from typing import Mapping, Optional

from django_brotli.middleware import BrotliMiddleware, MIN_LEN_FOR_RESPONSE_TO_PROCESS
from .utils import UTF8_LOREM_IPSUM_IN_CZECH
Expand Down Expand Up @@ -37,6 +37,9 @@ def __init__(self, content: str, headers: Optional[Mapping[str, str]] = None, st
def has_header(self, header: str) -> bool:
return header in self.headers

def get(self, key):
return self.headers.get(key, None)

def __getitem__(self, header: str) -> str:
return self.headers[header]

Expand Down
14 changes: 8 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
[tox]
envlist =
{py35}-django18
{py35}-django19
{py35}-django110
{py36}-django18
{py36}-django19
{py36}-django110
{py36}-django111
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/activeview
commands = pytest tests/
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10
django18: Django>=1.8, <1.9
django19: Django>=1.9, <1.10
django110: Django>=1.10, <1.11
django111: Django>=1.11, <2.0
pytest
brotlipy

0 comments on commit d1dc61d

Please sign in to comment.