test without mock

This commit is contained in:
Alysia Broddrick 2023-06-09 13:59:51 -07:00
parent 3884536869
commit 09c9e1eed8
No known key found for this signature in database
GPG key ID: 03917052CD0F06B7

View file

@ -5,9 +5,12 @@ from registrar.models import (
DomainApplication,
User,
Domain,
PublicContact
)
from unittest import skip
##delete me
from django.core.cache import cache
class TestDomain(TestCase):
def test_empty_create_fails(self):
@ -21,6 +24,26 @@ class TestDomain(TestCase):
# this assertion will not work -- for now, the fact that the
# above command didn't error out is proof enough
# self.assertEquals(domain.state, Domain.State.DRAFTED)
def test_cache(self):
# domain, _= Domain.objects.get_or_create(name="igorville.gov")
domain, _ = Domain.objects.get_or_create(name="igorville.gov")
sec=domain.security_contact
print(sec)
print("domain cache is as follows\n")
#would have expected the cache to contain the value
print(domain._cache)
print("\n")
domain.registrant = 'abc123'
r=domain.registrant
print(domain._cache)
@skip("cannot activate a domain without mock registry")
def test_get_status(self):