Make organisation logo nullable

Now we have the org banner branding, not all organisations need a logo.
So it shouldn’t be an error to not provide one.
This commit is contained in:
Chris Hill-Scott
2017-09-20 11:03:48 +01:00
parent 4d1c0a36c6
commit bde6a9e131
5 changed files with 30 additions and 13 deletions

View File

@@ -21,20 +21,13 @@ def test_create_organisation(notify_db, notify_db_session):
def test_create_organisation_without_name_or_colour_is_valid(notify_db, notify_db_session):
organisation = create_organisation(name=None, colour=None)
organisation = create_organisation(logo=None, name=None, colour=None)
assert Organisation.query.count() == 1
organisation_from_db = Organisation.query.first()
assert organisation == organisation_from_db
def test_create_organisation_without_logo_raises_error(notify_db, notify_db_session):
with pytest.raises(IntegrityError) as excinfo:
create_organisation(logo=None)
assert 'column "logo" violates not-null constraint' in str(excinfo.value)
assert Organisation.query.count() == 0
def test_get_organisations_gets_all_organisations(notify_db, notify_db_session):
org_1 = create_organisation(name='test_org_1')
org_2 = create_organisation(name='test_org_2')