|
|
@ -118,7 +118,7 @@ class TestWithLogin(TestCase): |
|
|
|
self.assertEqual(obj3.project_of_year,3) |
|
|
|
|
|
|
|
def test_finance_id(self): |
|
|
|
''' test if the finance id is resettet ad start of year''' |
|
|
|
''' test if the finance counting is correct''' |
|
|
|
acc = Account.objects.create(code='1234', description='blabla') |
|
|
|
startdate = date(2022,1,1) |
|
|
|
obj = Project.objects.create(account= acc, name='testproject', start=startdate) |
|
|
@ -133,22 +133,22 @@ class TestWithLogin(TestCase): |
|
|
|
obj3 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
|
self.assertEqual(obj3.finance_id,"1234003") |
|
|
|
|
|
|
|
def test_pid(self): |
|
|
|
''' test if the finance id is resettet ad start of year''' |
|
|
|
acc = Account.objects.create(code='1234', description='blabla') |
|
|
|
startdate = date(2022,1,1) |
|
|
|
obj = Project.objects.create(account= acc, name='testproject', start=startdate) |
|
|
|
self.assertEqual(obj.pid,"1234001") |
|
|
|
self.assertEqual(obj.account.code,"1234") |
|
|
|
|
|
|
|
obj2 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
|
self.assertEqual(obj2.pid,"1234002") |
|
|
|
|
|
|
|
olddate = date(2021,12,31) |
|
|
|
obj4 = Project.objects.create(account= acc, name='testproject2', start=olddate) |
|
|
|
|
|
|
|
obj3 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
|
self.assertEqual(obj3.pid,"1234004") |
|
|
|
# def test_pid(self): |
|
|
|
# ''' test if the pid counting is correct ''' |
|
|
|
# acc = Account.objects.create(code='1234', description='blabla') |
|
|
|
# startdate = date(2022,1,1) |
|
|
|
# obj = Project.objects.create(account= acc, name='testproject', start=startdate) |
|
|
|
# self.assertEqual(obj.pid,"1234001") |
|
|
|
# self.assertEqual(obj.account.code,"1234") |
|
|
|
# |
|
|
|
# obj2 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
|
# self.assertEqual(obj2.pid,"1234002") |
|
|
|
# |
|
|
|
# olddate = date(2021,12,31) |
|
|
|
# obj4 = Project.objects.create(account= acc, name='testproject2', start=olddate) |
|
|
|
# |
|
|
|
# obj3 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
|
# self.assertEqual(obj3.pid,"1234004") |
|
|
|
|
|
|
|
def test_literature(self): |
|
|
|
obj = Literature.objects.create(cost='100', notes='jolo') |
|
|
|