Add tox support

gitter-badge
Gergely Polonkai 8 years ago
parent a53b2827a9
commit e00515c160

2
.gitignore vendored

@ -2,3 +2,5 @@
.coverage
db.sqlite3
/htmlcov/
/.tox/
MANIFEST

@ -0,0 +1 @@
Django==1.8.7

@ -0,0 +1,11 @@
#! /usr/bin/env python
from distutils.core import setup
setup(name='WordChallenge',
version='0.1',
description='100(ish) word challenge',
author='Gergely Polonkai',
author_email='gergely@polonkai.eu',
url='https://github.com/gergelypolonkai/word-challenge',
packages=['wordchallenge', 'words'])

@ -0,0 +1,13 @@
# Tox (http://tox.testrun.org/) 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]
envlist = py27,py34
[testenv]
commands = coverage run manage.py test
deps =
-rrequirements.txt
coverage

@ -2,8 +2,10 @@ from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import get_language
@python_2_unicode_compatible
class Word(models.Model):
def translation(self, language):
try:
@ -25,6 +27,7 @@ class Word(models.Model):
return ""
@python_2_unicode_compatible
class WordTranslation(models.Model):
word = models.ForeignKey(Word, related_name='translations')
language = models.CharField(max_length=5, db_index=True)

@ -1,3 +1,4 @@
# -*- coding: utf-8
from datetime import timedelta
from django.conf import settings
from django.contrib.auth.models import User

Loading…
Cancel
Save