From 18233aa4e63f90d02aeca91f7d5a0eb2744fb499 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Thu, 31 Mar 2022 15:17:32 +0200 Subject: [PATCH] added example tests --- server/vbv_lernwelt/core/tests/test_user.py | 16 ++++++++++++++++ .../learnpath/management/__init__.py | 9 +++++++++ .../learnpath/management/commands/__init__.py | 0 server/vbv_lernwelt/learnpath/tests.py | 3 --- .../tests/test_create_default_learning_path.py | 13 ------------- .../learnpath/tests/test_whatever.py | 14 ++++++++++++++ 6 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 server/vbv_lernwelt/core/tests/test_user.py create mode 100644 server/vbv_lernwelt/learnpath/management/__init__.py create mode 100644 server/vbv_lernwelt/learnpath/management/commands/__init__.py delete mode 100644 server/vbv_lernwelt/learnpath/tests.py create mode 100644 server/vbv_lernwelt/learnpath/tests/test_whatever.py diff --git a/server/vbv_lernwelt/core/tests/test_user.py b/server/vbv_lernwelt/core/tests/test_user.py new file mode 100644 index 00000000..b29b6077 --- /dev/null +++ b/server/vbv_lernwelt/core/tests/test_user.py @@ -0,0 +1,16 @@ +from django.test import TestCase + +from server.vbv_lernwelt.core.models import User +from vbv_lernwelt.core.tests.factories import UserFactory +from vbv_lernwelt.simpletodo.models import SimpleList + + +class TestUserCreation(TestCase): + def test_create_user(self): + User(name='Sepp').save() + + def test_simple(self): + # create_default_learning_path() + self.user = UserFactory() + SimpleList.objects.get_or_create(title='Default', user=self.user) + self.assertTrue(True) diff --git a/server/vbv_lernwelt/learnpath/management/__init__.py b/server/vbv_lernwelt/learnpath/management/__init__.py new file mode 100644 index 00000000..536f0e29 --- /dev/null +++ b/server/vbv_lernwelt/learnpath/management/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# +# Iterativ GmbH +# http://www.iterativ.ch/ +# +# Copyright (c) 2015 Iterativ GmbH. All rights reserved. +# +# Created on 2022-03-31 +# @author: lorenz.padberg@iterativ.ch diff --git a/server/vbv_lernwelt/learnpath/management/commands/__init__.py b/server/vbv_lernwelt/learnpath/management/commands/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/server/vbv_lernwelt/learnpath/tests.py b/server/vbv_lernwelt/learnpath/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/server/vbv_lernwelt/learnpath/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/server/vbv_lernwelt/learnpath/tests/test_create_default_learning_path.py b/server/vbv_lernwelt/learnpath/tests/test_create_default_learning_path.py index 2e5ca4ce..2886f7f6 100644 --- a/server/vbv_lernwelt/learnpath/tests/test_create_default_learning_path.py +++ b/server/vbv_lernwelt/learnpath/tests/test_create_default_learning_path.py @@ -1,14 +1,3 @@ -# -*- coding: utf-8 -*- -# -# Iterativ GmbH -# http://www.iterativ.ch/ -# -# Copyright (c) 2015 Iterativ GmbH. All rights reserved. -# -# Created on 2022-03-29 -# @author: lorenz.padberg@iterativ.ch - - from django.test import TestCase from server.vbv_lernwelt.learnpath.models import LearningPath @@ -19,5 +8,3 @@ class TestCreateDefaultLearningPaths(TestCase): def test_create_learning_path(self): create_default_learning_path() self.assertTrue(LearningPath.objects.filter(title="Versicherungsvermittler/in").exist()) - - diff --git a/server/vbv_lernwelt/learnpath/tests/test_whatever.py b/server/vbv_lernwelt/learnpath/tests/test_whatever.py new file mode 100644 index 00000000..ae8c47b6 --- /dev/null +++ b/server/vbv_lernwelt/learnpath/tests/test_whatever.py @@ -0,0 +1,14 @@ + +from django.test import TestCase + +from server.vbv_lernwelt.core.models import User + + +class TestWhatever(TestCase): + def test_print(self): + print("hallo " * 80) + + def test_user(self): + + User.objects.get_or_create(name='hallo ') +