added locale test
This commit is contained in:
parent
1b3ce68885
commit
03640646be
|
|
@ -1,5 +1,9 @@
|
||||||
|
from vbv_lernwelt.learnpath.models import LearningPath
|
||||||
from vbv_lernwelt.learnpath.tests.learningpath_factories import LearningPathFactory
|
from vbv_lernwelt.learnpath.tests.learningpath_factories import LearningPathFactory
|
||||||
|
|
||||||
|
|
||||||
def create_default_learning_path():
|
def create_default_learning_path():
|
||||||
lp = LearningPathFactory(title="Versicherungsvermittler/in")
|
|
||||||
|
lp = LearningPath()
|
||||||
|
lp.save()
|
||||||
|
#lp = LearningPathFactory()
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,16 @@
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
|
import locale
|
||||||
from vbv_lernwelt.learnpath.models import LearningPath
|
from vbv_lernwelt.learnpath.models import LearningPath
|
||||||
from vbv_lernwelt.learnpath.tests.create_default_learning_path import create_default_learning_path
|
from vbv_lernwelt.learnpath.tests.create_default_learning_path import create_default_learning_path
|
||||||
|
from django.utils.translation import to_locale, get_language
|
||||||
|
|
||||||
|
|
||||||
class TestCreateDefaultLearningPaths(TestCase):
|
class TestCreateDefaultLearningPaths(TestCase):
|
||||||
def test_create_learning_path(self):
|
def test_create_learning_path(self):
|
||||||
create_default_learning_path()
|
print(locale.getdefaultlocale())
|
||||||
self.assertTrue(LearningPath.objects.filter(title="Versicherungsvermittler/in").exist())
|
print(to_locale(get_language()))
|
||||||
|
|
||||||
|
create_default_learning_path()
|
||||||
|
qs = LearningPath.objects.filter(title="Versicherungsvermittler/in")
|
||||||
|
self.assertTrue(qs.exists())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue