From e4c8967a07a9b8f3a15c5bed69de36886852e2b1 Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Thu, 30 Sep 2021 15:29:50 +0200 Subject: [PATCH] pid test working (and failing - as it should) --- input/models.py | 4 ++-- input/tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/input/models.py b/input/models.py index 423e7fb..b3325d1 100644 --- a/input/models.py +++ b/input/models.py @@ -89,9 +89,9 @@ class Project(Volunteer): def save(self,*args,**kwargs): # is there a way to call super().save() only once? print(f'1: {self.id}') - #super().save(*args,**kwargs) + # super().save(*args,**kwargs) print(f'2: {self.id}') - self.pid = str(self.account) + str(self.pk).zfill(3) + self.pid = str(self.account.code) + str(self.pk).zfill(3) print(f'3: {self.id}') super().save(*args,**kwargs) diff --git a/input/tests.py b/input/tests.py index c4af97d..9b5b708 100644 --- a/input/tests.py +++ b/input/tests.py @@ -50,5 +50,5 @@ class TestWithLogin(TestCase): #acc.save() obj = Project.objects.create(account= acc, name='testproject', start='2022-01-01') #obj.save() - print(obj.pid) - self.assertEqual(True,True) + print(f'pid: {obj.pid}') + self.assertEqual(obj.pid,'1234000')