|
@ -1,6 +1,7 @@ |
|
|
from django.test import TestCase, Client |
|
|
from django.test import TestCase, Client |
|
|
from django.conf import settings |
|
|
from django.conf import settings |
|
|
from django.contrib.auth.models import User |
|
|
from django.contrib.auth.models import User |
|
|
|
|
|
from datetime import date |
|
|
|
|
|
|
|
|
from .models import HonoraryCertificate, Project, Account |
|
|
from .models import HonoraryCertificate, Project, Account |
|
|
|
|
|
|
|
@ -43,12 +44,13 @@ class TestWithLogin(TestCase): |
|
|
response = self.client.get('/intern') |
|
|
response = self.client.get('/intern') |
|
|
self.assertContains(response,'Übersicht aller Förderangebote') |
|
|
self.assertContains(response,'Übersicht aller Förderangebote') |
|
|
|
|
|
|
|
|
def test_project_pid(self): |
|
|
|
|
|
''' test if the project pid is resettet ad start of year''' |
|
|
|
|
|
|
|
|
def test_project_of_year(self): |
|
|
|
|
|
''' test if the finance id is resettet ad start of year''' |
|
|
# self.client.login(username='vladimir', password='reiherzehe') |
|
|
# self.client.login(username='vladimir', password='reiherzehe') |
|
|
acc = Account.objects.create(code='1234', description='blabla') |
|
|
acc = Account.objects.create(code='1234', description='blabla') |
|
|
#acc.save() |
|
|
#acc.save() |
|
|
obj = Project.objects.create(account= acc, name='testproject', start='2022-01-01') |
|
|
|
|
|
|
|
|
startdate = date(2022,1,1) |
|
|
|
|
|
obj = Project.objects.create(account= acc, name='testproject', start=startdate) |
|
|
#obj.save() |
|
|
#obj.save() |
|
|
print(f'pid: {obj.finance_id}') |
|
|
|
|
|
self.assertEqual(obj.finance_id,'1234000') |
|
|
|
|
|
|
|
|
print(f'pid: {obj.project_of_year}') |
|
|
|
|
|
self.assertEqual(obj.project_of_year,1) |