Fix tests.

Fix copy/paste error in the history table
This commit is contained in:
Rebecca Law
2017-03-02 12:12:01 +00:00
parent beb7fda32b
commit 6386cb968a
3 changed files with 5 additions and 4 deletions

View File

@@ -17,10 +17,10 @@ from alembic import op
def upgrade(): def upgrade():
provider_id = str(uuid.uuid4()) provider_id = str(uuid.uuid4())
op.execute( op.execute(
"INSERT INTO provider_details (id, display_name, identifier, priority, notification_type, active, version) values ('{}', 'DVLA', 'dvla', 10, 'letter', true, 1)".format(provider_id) "INSERT INTO provider_details (id, display_name, identifier, priority, notification_type, active, version) values ('{}', 'DVLA', 'dvla', 50, 'letter', true, 1)".format(provider_id)
) )
op.execute( op.execute(
"INSERT INTO provider_details_history (id, display_name, identifier, priority, notification_type, active, version) values ('{}', 'DVLA', 'mmg', 10, 'sms', true, 1)".format(provider_id) "INSERT INTO provider_details_history (id, display_name, identifier, priority, notification_type, active, version) values ('{}', 'DVLA', 'dvla', 50, 'letter', true, 1)".format(provider_id)
) )
op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) VALUES ('{}', '{}', 1.0, '{}')".format(uuid.uuid4(), datetime.utcnow(), provider_id)) op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) VALUES ('{}', '{}', 1.0, '{}')".format(uuid.uuid4(), datetime.utcnow(), provider_id))

View File

@@ -31,7 +31,7 @@ def set_primary_sms_provider(identifier):
def test_can_get_all_providers(restore_provider_details): def test_can_get_all_providers(restore_provider_details):
assert len(get_provider_details()) == 4 assert len(get_provider_details()) == 5
def test_can_get_sms_providers(restore_provider_details): def test_can_get_sms_providers(restore_provider_details):

View File

@@ -13,12 +13,13 @@ def test_get_provider_details_in_type_and_identifier_order(client, notify_db):
) )
assert response.status_code == 200 assert response.status_code == 200
json_resp = json.loads(response.get_data(as_text=True))['provider_details'] json_resp = json.loads(response.get_data(as_text=True))['provider_details']
assert len(json_resp) == 4 assert len(json_resp) == 5
assert json_resp[0]['identifier'] == 'ses' assert json_resp[0]['identifier'] == 'ses'
assert json_resp[1]['identifier'] == 'mmg' assert json_resp[1]['identifier'] == 'mmg'
assert json_resp[2]['identifier'] == 'firetext' assert json_resp[2]['identifier'] == 'firetext'
assert json_resp[3]['identifier'] == 'loadtesting' assert json_resp[3]['identifier'] == 'loadtesting'
assert json_resp[4]['identifier'] == 'dvla'
def test_get_provider_details_by_id(client, notify_db): def test_get_provider_details_by_id(client, notify_db):