diff options
Diffstat (limited to 'ctrack/organisations/tests/test_models.py')
-rw-r--r-- | ctrack/organisations/tests/test_models.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/ctrack/organisations/tests/test_models.py b/ctrack/organisations/tests/test_models.py index d070a84..946fda5 100644 --- a/ctrack/organisations/tests/test_models.py +++ b/ctrack/organisations/tests/test_models.py @@ -1,7 +1,7 @@ import pytest from slugify import slugify -from ..models import Organisation, Address +from ..models import Organisation pytestmark = pytest.mark.django_db @@ -11,12 +11,10 @@ def test_organisation_get_absolute_url(org: Organisation): assert org.get_absolute_url() == f"/organisations/{slug}/" -def test_create_organisation(addr: Address): - Organisation(name="Big Bad OES Corporation", address=addr).save() +def test_create_organisation(): + Organisation(name="Big Bad OES Corporation").save() # The organisation is saved in the db assert Organisation.objects.get(name="Big Bad OES Corporation") - # The organisation has the correct address - assert Organisation.objects.get(name="Big Bad OES Corporation").address.type.descriptor == "Primary Address" def test_delete_organisation(org: Organisation): @@ -30,9 +28,5 @@ def test_delete_organisation(org: Organisation): def test_update_organisation(org: Organisation): # Change the name of the organisation org.name = "Tonkers Ltd" - # Get current value of line1 of the address - addr_line1 = org.address.line1 org.save() assert org.name == "Tonkers Ltd" - # Assert that the address hasn't changed - assert addr_line1 == org.address.line1 |