Fixed tests to run from any project, resolving #6 (thanks to carl.j.meyer).

This commit is contained in:
Dirk Eschler 2010-02-16 10:01:23 +00:00
parent 4a5fd40ec2
commit 353a4c8f65

View file

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import models
@ -10,6 +10,9 @@ from django.utils.thread_support import currentThread
from modeltranslation import translator
settings.LANGUAGES = (('de', 'Deutsch'),
('en', 'English'))
class TestModel(models.Model):
title = models.CharField(max_length=255)
text = models.TextField(null=True)
@ -17,6 +20,7 @@ class TestModel(models.Model):
class TestTranslationOptions(translator.TranslationOptions):
fields = ('title', 'text',)
translator.translator._registry = {}
translator.translator.register(TestModel, TestTranslationOptions)
class ModelTranslationTest(TestCase):