Exemplo n.º 1
0
    def test_name_uniqness(self, valid_organization):
        org = Organization()
        org.slug = valid_organization.slug
        with pytest.raises(ValidationError) as e:
            org.full_clean()

        assert "'slug': " in str(e.value)
Exemplo n.º 2
0
 def test_required_fields_validation(self):
     org = Organization()
     with pytest.raises(ValidationError) as e:
         org.full_clean()
     e = str(e.value)
     assert "'title'" in e
     assert "'postal_code'" in e
     assert "'city'" in e
     assert "'street'" in e
     # assert "'street_number'" in e
     # assert "'flat_number'" in e
     assert "'street_type'" in e
     assert "'email'" in e
     assert "'fax'" in e
     assert "'tel'" in e
     assert "'epuap'" in e
     assert "'regon'" in e
     assert "'website'" in e