from django.test import TestCase

from vbv_lernwelt.learnpath.models_competences import Competence, FullfillmentCriteria
from vbv_lernwelt.learnpath.tests.competences_factories import CompetencePageFactory, CompetenceFactory, \
    FullfilmentCriteriaFactory


class TestCompetencesFactories(TestCase):
    def test_create_competences_page(self):
        CompetencePageFactory()

    def test_create_competence(self):
        CompetenceFactory(name='Boogie Woogie')
        self.assertEqual(Competence.objects.filter(name='Boogie Woogie').count(), 1)

    def test_create_fullfillment_criteria(self):
        FullfilmentCriteriaFactory(name='shuffle like ...')
        self.assertEqual(FullfillmentCriteria.objects.filter(name='shuffle like ...').count(), 1)
