The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ
Browse Source

Add tox support

gitter-badge
Gergely Polonkai 7 years ago
parent
commit
e00515c160
  1. 2
      .gitignore
  2. 1
      requirements.txt
  3. 11
      setup.py
  4. 13
      tox.ini
  5. 3
      words/models.py
  6. 1
      words/tests.py

2
.gitignore vendored

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

1
requirements.txt

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

11
setup.py

@ -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'])

13
tox.ini

@ -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

3
words/models.py

@ -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
words/tests.py

@ -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