diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/organisations/tests/test_forms.py | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/ctrack/organisations/tests/test_forms.py b/ctrack/organisations/tests/test_forms.py index b742d10..322c856 100644 --- a/ctrack/organisations/tests/test_forms.py +++ b/ctrack/organisations/tests/test_forms.py @@ -10,33 +10,40 @@ pytestmark = pytest.mark.django_db # is instructive # Can the form accept an org_id? We need this. -def test_add_new_address_for_organisation_form(org): - AddressCreateForm(org=org) +@pytest.mark.skip("Explore how the inline form address addresses to an organisation") +def test_add_new_address_for_organisation_form(org_with_people): + AddressCreateForm(org=org_with_people) # Will our form raise an exception if the org_id isn't specified? -def test_add_new_address_init_without_org_id(org): +@pytest.mark.skip("Explore how the inline form address addresses to an organisation") +def test_add_new_address_init_without_org_id(org_with_people): with pytest.raises(KeyError): AddressCreateForm() -def test_add_new_address_with_valid_data(org): +@pytest.mark.skip("Explore how the inline form address addresses to an organisation") +def test_add_new_address_with_valid_data(org_with_people): at = AddressType.objects.create(descriptor="Primary Address").pk - form = AddressCreateForm({ - "type": at, - "line1": "10 Bawbags Lane", - "line2": "Awful Area", - "line3": "Chudleigh Meadows", - "city": "Curstan", - "county": "East Suncto", - "postcode": "ET31 3PF", - "country": "UK", - "other_details": "There is nothing great about this place!", - }, org=org) - - -def test_add_new_address_blank_data(org): - form = AddressCreateForm({}, org=org) + form = AddressCreateForm( + { + "type": at, + "line1": "10 Bawbags Lane", + "line2": "Awful Area", + "line3": "Chudleigh Meadows", + "city": "Curstan", + "county": "East Suncto", + "postcode": "ET31 3PF", + "country": "UK", + "other_details": "There is nothing great about this place!", + }, + org=org_with_people, + ) + + +@pytest.mark.skip("Explore how the inline form address addresses to an organisation") +def test_add_new_address_blank_data(org_with_people): + form = AddressCreateForm({}, org=org_with_people) assert not form.is_valid() assert form.errors == { "type": ["This field is required."], |