1
0
Fork 0

first test

This commit is contained in:
Benni Bärmann 2020-11-23 14:08:01 +01:00
parent 89bd3b0de6
commit b398b3a511
1 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,14 @@
from django.test import TestCase
from .models import HonoraryCertificate
# Create your tests here.
class TestGranted(TestCase):
def test_set_granted(self):
obj = HonoraryCertificate.objects.create(realname='hurzel',email='hurzel@web.de')
self.assertEqual(obj.granted,None)
print(obj.pk)
HonoraryCertificate.set_granted(obj.pk, True)
obj2 = HonoraryCertificate.objects.get(pk=obj.pk)
self.assertEqual(obj2.granted,True)