You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
474 B

4 years ago
4 years ago
  1. from django.test import TestCase
  2. from .models import HonoraryCertificate
  3. # Create your tests here.
  4. class TestGranted(TestCase):
  5. def test_set_granted(self):
  6. obj = HonoraryCertificate.objects.create(realname='hurzel',email='hurzel@web.de')
  7. self.assertEqual(obj.granted,None)
  8. print(obj.pk)
  9. HonoraryCertificate.set_granted(obj.pk, True)
  10. obj2 = HonoraryCertificate.objects.get(pk=obj.pk)
  11. self.assertEqual(obj2.granted,True)