|
@ -3,7 +3,7 @@ from django.conf import settings |
|
|
from django.contrib.auth.models import User |
|
|
from django.contrib.auth.models import User |
|
|
from datetime import date |
|
|
from datetime import date |
|
|
|
|
|
|
|
|
from .models import HonoraryCertificate, Project, Account |
|
|
|
|
|
|
|
|
from .models import HonoraryCertificate, Project, Account, Literature |
|
|
|
|
|
|
|
|
class TestWithoutLogin(TestCase): |
|
|
class TestWithoutLogin(TestCase): |
|
|
|
|
|
|
|
@ -85,6 +85,7 @@ class TestWithLogin(TestCase): |
|
|
startdate = date(2022,1,1) |
|
|
startdate = date(2022,1,1) |
|
|
obj = Project.objects.create(account= acc, name='testproject', start=startdate) |
|
|
obj = Project.objects.create(account= acc, name='testproject', start=startdate) |
|
|
self.assertEqual(obj.pid,"1234001") |
|
|
self.assertEqual(obj.pid,"1234001") |
|
|
|
|
|
self.assertEqual(obj.account.code,"1234") |
|
|
|
|
|
|
|
|
obj2 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
obj2 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
self.assertEqual(obj2.pid,"1234002") |
|
|
self.assertEqual(obj2.pid,"1234002") |
|
@ -94,3 +95,7 @@ class TestWithLogin(TestCase): |
|
|
|
|
|
|
|
|
obj3 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
obj3 = Project.objects.create(account= acc, name='testproject2', start=startdate) |
|
|
self.assertEqual(obj3.pid,"1234004") |
|
|
self.assertEqual(obj3.pid,"1234004") |
|
|
|
|
|
|
|
|
|
|
|
def test_literature(self): |
|
|
|
|
|
obj = Literature.objects.create(cost='100', notes='jolo') |
|
|
|
|
|
self.assertEqual(obj.service_id,'Literature1') |