mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 14:42:24 -05:00
remove loadtesting from the database
This commit is contained in:
39
migrations/versions/0308_delete_loadtesting_provider.py
Normal file
39
migrations/versions/0308_delete_loadtesting_provider.py
Normal file
@@ -0,0 +1,39 @@
|
||||
"""
|
||||
Remove loadtesting provider
|
||||
|
||||
Revision ID: 0308_delete_loadtesting_provider
|
||||
Revises: 0307_delete_dm_datetime
|
||||
Create Date: 2019-10-22 17:30
|
||||
|
||||
"""
|
||||
import uuid
|
||||
from alembic import op
|
||||
from sqlalchemy.sql import text
|
||||
|
||||
revision = '0308_delete_loadtesting_provider'
|
||||
down_revision = '0307_delete_dm_datetime'
|
||||
|
||||
|
||||
def upgrade():
|
||||
conn = op.get_bind()
|
||||
conn.execute("DELETE FROM provider_details WHERE identifier = 'loadtesting'")
|
||||
conn.execute("DELETE FROM provider_details_history WHERE identifier = 'loadtesting'")
|
||||
|
||||
|
||||
def downgrade():
|
||||
conn = op.get_bind()
|
||||
conn.execute(
|
||||
text("""
|
||||
INSERT INTO
|
||||
provider_details
|
||||
(id, display_name, identifier, priority, notification_type, active, version, supports_international)
|
||||
VALUES
|
||||
(:uuid, 'Loadtesting', 'loadtesting', 100, 'sms', true, 1, false);
|
||||
INSERT INTO
|
||||
provider_details_history
|
||||
(id, display_name, identifier, priority, notification_type, active, version, supports_international)
|
||||
VALUES
|
||||
(:uuid, 'Loadtesting', 'loadtesting', 100, 'sms', true, 1, false)
|
||||
"""),
|
||||
uuid=uuid.uuid4()
|
||||
)
|
||||
@@ -326,9 +326,6 @@ def test_dao_get_provider_stats(notify_db_session):
|
||||
assert result[2].active is True
|
||||
assert result[2].current_month_billable_sms == 5
|
||||
|
||||
assert result[3].identifier == 'loadtesting'
|
||||
assert result[3].identifier == 'dvla'
|
||||
assert result[3].current_month_billable_sms == 0
|
||||
|
||||
assert result[4].identifier == 'dvla'
|
||||
assert result[4].current_month_billable_sms == 0
|
||||
assert result[4].supports_international is False
|
||||
assert result[3].supports_international is False
|
||||
|
||||
@@ -20,8 +20,7 @@ def test_get_provider_details_in_type_and_identifier_order(client, notify_db):
|
||||
assert json_resp[0]['identifier'] == 'ses'
|
||||
assert json_resp[1]['identifier'] == 'mmg'
|
||||
assert json_resp[2]['identifier'] == 'firetext'
|
||||
assert json_resp[3]['identifier'] == 'loadtesting'
|
||||
assert json_resp[4]['identifier'] == 'dvla'
|
||||
assert json_resp[3]['identifier'] == 'dvla'
|
||||
|
||||
|
||||
def test_get_provider_details_by_id(client, notify_db):
|
||||
|
||||
Reference in New Issue
Block a user