Renamed migration script and refactor code

This commit is contained in:
Ken Tsang
2017-07-07 14:48:00 +01:00
parent b814c5ff26
commit 3b1f229384
5 changed files with 12 additions and 17 deletions

View File

@@ -39,7 +39,7 @@ from app.dao.invited_user_dao import save_invited_user
from app.dao.provider_rates_dao import create_provider_rates
from app.clients.sms.firetext import FiretextClient
from tests import create_authorization_header
from tests.app.db import create_user, create_template, create_notification, create_organisation
from tests.app.db import create_user, create_template, create_notification
@pytest.yield_fixture
@@ -974,10 +974,6 @@ def sample_provider_rate(notify_db, notify_db_session, valid_from=None, rate=Non
)
def sample_organisation(notify_db, notify_db_session):
create_organisation()
@pytest.fixture
def restore_provider_details(notify_db, notify_db_session):
"""

View File

@@ -35,12 +35,14 @@ def test_create_organisation_without_logo_raises_error(notify_db, notify_db_sess
def test_get_organisations_gets_all_organisations(notify_db, notify_db_session):
create_organisation(name='test_org_1')
create_organisation(name='test_org_2')
org_1 = create_organisation(name='test_org_1')
org_2 = create_organisation(name='test_org_2')
organisations = dao_get_organisations()
assert len(organisations) == 2
assert org_1 == organisations[0]
assert org_2 == organisations[1]
def test_get_organisation_by_id_gets_correct_organisation(notify_db, notify_db_session):