Commits

eschler  committed 918b324

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

  • Participants
  • Parent commits 5a45a9d

Comments (0)

Files changed (1)

File modeltranslation/tests.py

-
+# -*- coding: utf-8 -*-
 from django.conf import settings
 from django.contrib.contenttypes.models import ContentType
 from django.db import models
 
 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)
 class TestTranslationOptions(translator.TranslationOptions):
     fields = ('title', 'text',)
 
+translator.translator._registry = {}
 translator.translator.register(TestModel, TestTranslationOptions)
 
 class ModelTranslationTest(TestCase):