added locale test

This commit is contained in:
Lorenz Padberg 2022-04-04 14:18:27 +02:00
parent 1b3ce68885
commit 03640646be
2 changed files with 13 additions and 4 deletions

View File

@ -1,5 +1,9 @@
from vbv_lernwelt.learnpath.models import LearningPath
from vbv_lernwelt.learnpath.tests.learningpath_factories import LearningPathFactory
def create_default_learning_path():
lp = LearningPathFactory(title="Versicherungsvermittler/in")
lp = LearningPath()
lp.save()
#lp = LearningPathFactory()

View File

@ -1,11 +1,16 @@
from django.test import TestCase
import locale
from vbv_lernwelt.learnpath.models import LearningPath
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):
def test_create_learning_path(self):
create_default_learning_path()
self.assertTrue(LearningPath.objects.filter(title="Versicherungsvermittler/in").exist())
print(locale.getdefaultlocale())
print(to_locale(get_language()))
create_default_learning_path()
qs = LearningPath.objects.filter(title="Versicherungsvermittler/in")
self.assertTrue(qs.exists())