Commit 3798d173 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

tests: Use tox for testing more Django and Python versions

parent 4a4d5288
Pipeline #12957 passed with stage
in 26 seconds
py27_django17:
script:
- "virtualenv-2.7 ./py27_django17"
- "./py27_django17/bin/pip install -U 'Django>=1.7,<1.8'"
- "./py27_django17/bin/python ./runtests.py"
py27_django18:
script:
- "virtualenv-2.7 ./py27_django18"
- "./py27_django18/bin/pip install -U 'Django>=1.8,<1.9'"
- "./py27_django18/bin/python ./runtests.py"
py27_django19:
script:
- "virtualenv-2.7 ./py27_django19"
- "./py27_django19/bin/pip install -U 'Django>=1.9,<1.10'"
- "./py27_django19/bin/python ./runtests.py"
stages:
- test
before_script:
- python3.6 -m venv $HOME/tox
- $HOME/tox/bin/pip install tox
py27-django18:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django18'
py27-django110:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django110'
py27-django111:
stage: test
script: $HOME/tox/bin/tox -e 'py27-django111'
py36-django18:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django18'
py36-django110:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django110'
py36-django111:
stage: test
script: $HOME/tox/bin/tox -e 'py36-django111'
......@@ -22,3 +22,13 @@ INSTALLED_APPS = [
ROOT_URLCONF = 'tests.urls'
SECRET_KEY = 'fake-key'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
},
},
]
\ No newline at end of file
from xml.dom.minidom import parseString
import xml.etree.ElementTree as ET
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import Client, TestCase
from django.utils import six
class Tuc2014TestCase(TestCase):
CONTENT_BLOCK = '<div id="id_tests_block_content">CONTENT_BLOCK</div>'
......@@ -11,4 +12,4 @@ class Tuc2014TestCase(TestCase):
def test_index(self):
response = self.client.get('/')
self.assertEquals(response.status_code, 200)
self.assertTrue(self.CONTENT_BLOCK in response.content)
\ No newline at end of file
self.assertTrue(self.CONTENT_BLOCK in six.text_type(response.content))
\ No newline at end of file
# Tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
skipsdist = true
envlist = py{27,36}-django{18,110,111}
[testenv]
commands = {envpython} runtests.py
deps =
django18: Django >= 1.8, < 1.9
django110: Django >= 1.10, < 1.11
django111: Django >= 1.11, < 2
setenv =
DJANGO_LIVE_TEST_SERVER_ADDRESS=localhost:9000-9200
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment