diff --git a/app/__init__.py b/app/__init__.py index 8e774cccb..0c2734f77 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -90,6 +90,7 @@ def register_blueprint(application): from app.provider_details.rest import provider_details as provider_details_blueprint from app.spec.rest import spec as spec_blueprint from app.organisation.rest import organisation_blueprint + from app.dvla_organisation.rest import dvla_organisation_blueprint from app.delivery.rest import delivery_blueprint from app.notifications.receive_notifications import receive_notifications_blueprint from app.notifications.notifications_ses_callback import ses_callback_blueprint @@ -148,6 +149,9 @@ def register_blueprint(application): organisation_blueprint.before_request(requires_admin_auth) application.register_blueprint(organisation_blueprint, url_prefix='/organisation') + dvla_organisation_blueprint.before_request(requires_admin_auth) + application.register_blueprint(dvla_organisation_blueprint, url_prefix='/dvla_organisations') + letter_job.before_request(requires_admin_auth) application.register_blueprint(letter_job) @@ -211,7 +215,7 @@ def create_uuid(): def create_random_identifier(): - return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16)) + return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(16)) def process_user_agent(user_agent_string): diff --git a/app/celery/tasks.py b/app/celery/tasks.py index a7ca9665c..464e3e1be 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -321,7 +321,8 @@ def create_dvla_file_contents(job_id): notification.template.__dict__, notification.personalisation, notification_reference=notification.reference, - contact_block=notification.service.letter_contact_block + contact_block=notification.service.letter_contact_block, + org_id=notification.service.dvla_organisation.id, )) for notification in dao_get_all_notifications_for_job(job_id) ) diff --git a/app/dao/dvla_organisation_dao.py b/app/dao/dvla_organisation_dao.py new file mode 100644 index 000000000..879671947 --- /dev/null +++ b/app/dao/dvla_organisation_dao.py @@ -0,0 +1,5 @@ +from app.models import DVLAOrganisation + + +def dao_get_dvla_organisations(): + return DVLAOrganisation.query.all() diff --git a/app/dao/provider_details_dao.py b/app/dao/provider_details_dao.py index 2992a0107..ff4db1a93 100644 --- a/app/dao/provider_details_dao.py +++ b/app/dao/provider_details_dao.py @@ -36,7 +36,8 @@ def get_alternative_sms_provider(identifier): def get_current_provider(notification_type): return ProviderDetails.query.filter_by( - notification_type=notification_type + notification_type=notification_type, + active=True ).order_by( asc(ProviderDetails.priority) ).first() diff --git a/app/dao/rates_dao.py b/app/dao/rates_dao.py new file mode 100644 index 000000000..47ed83a4e --- /dev/null +++ b/app/dao/rates_dao.py @@ -0,0 +1,11 @@ +from sqlalchemy import desc + +from app import db +from app.models import Rate + + +def get_rate_for_type_and_date(notification_type, date_sent): + return db.session.query(Rate).filter(Rate.notification_type == notification_type, + Rate.valid_from <= date_sent + ).order_by(Rate.valid_from.desc() + ).limit(1).first() diff --git a/app/dvla_organisation/__init__.py b/app/dvla_organisation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/app/dvla_organisation/rest.py b/app/dvla_organisation/rest.py new file mode 100644 index 000000000..acf9e09e0 --- /dev/null +++ b/app/dvla_organisation/rest.py @@ -0,0 +1,14 @@ +from flask import Blueprint, jsonify + +from app.dao.dvla_organisation_dao import dao_get_dvla_organisations +from app.errors import register_errors + +dvla_organisation_blueprint = Blueprint('dvla_organisation', __name__) +register_errors(dvla_organisation_blueprint) + + +@dvla_organisation_blueprint.route('', methods=['GET']) +def get_dvla_organisations(): + return jsonify({ + org.id: org.name for org in dao_get_dvla_organisations() + }) diff --git a/app/models.py b/app/models.py index fa3fb3779..d54f413e4 100644 --- a/app/models.py +++ b/app/models.py @@ -115,6 +115,16 @@ class Organisation(db.Model): name = db.Column(db.String(255), nullable=True) +DVLA_ORG_HM_GOVERNMENT = '001' +DVLA_ORG_LAND_REGISTRY = '500' + + +class DVLAOrganisation(db.Model): + __tablename__ = 'dvla_organisation' + id = db.Column(db.String, primary_key=True) + name = db.Column(db.String(255), nullable=True) + + class Service(db.Model, Versioned): __tablename__ = 'services' @@ -141,6 +151,7 @@ class Service(db.Model, Versioned): restricted = db.Column(db.Boolean, index=False, unique=False, nullable=False) research_mode = db.Column(db.Boolean, index=False, unique=False, nullable=False, default=False) can_send_letters = db.Column(db.Boolean, nullable=False, default=False) + can_send_international_sms = db.Column(db.Boolean, nullable=False, default=False) email_from = db.Column(db.Text, index=False, unique=True, nullable=False) created_by = db.relationship('User') created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), index=True, nullable=False) @@ -149,6 +160,14 @@ class Service(db.Model, Versioned): sms_sender = db.Column(db.String(11), nullable=True) organisation_id = db.Column(UUID(as_uuid=True), db.ForeignKey('organisation.id'), index=True, nullable=True) organisation = db.relationship('Organisation') + dvla_organisation_id = db.Column( + db.String, + db.ForeignKey('dvla_organisation.id'), + index=True, + nullable=False, + default=DVLA_ORG_HM_GOVERNMENT + ) + dvla_organisation = db.relationship('DVLAOrganisation') branding = db.Column( db.String(255), db.ForeignKey('branding_type.name'), @@ -926,3 +945,12 @@ class Event(db.Model): nullable=False, default=datetime.datetime.utcnow) data = db.Column(JSON, nullable=False) + + +class Rate(db.Model): + __tablename__ = 'rates' + + id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + valid_from = db.Column(db.DateTime, nullable=False) + rate = db.Column(db.Numeric(), nullable=False) + notification_type = db.Column(notification_types, index=True, nullable=False) diff --git a/app/schemas.py b/app/schemas.py index 9402a7e44..510d7e59e 100644 --- a/app/schemas.py +++ b/app/schemas.py @@ -177,6 +177,7 @@ class ServiceSchema(BaseSchema): created_by = field_for(models.Service, 'created_by', required=True) organisation = field_for(models.Service, 'organisation') branding = field_for(models.Service, 'branding') + dvla_organisation = field_for(models.Service, 'dvla_organisation') class Meta: model = models.Service diff --git a/migrations/versions/0072_add_dvla_orgs.py b/migrations/versions/0072_add_dvla_orgs.py new file mode 100644 index 000000000..6dbce0c4b --- /dev/null +++ b/migrations/versions/0072_add_dvla_orgs.py @@ -0,0 +1,60 @@ +"""empty message + +Revision ID: 0072_add_dvla_orgs +Revises: 0071_add_job_error_state +Create Date: 2017-04-19 15:25:45.155886 + +""" + +# revision identifiers, used by Alembic. +revision = '0072_add_dvla_orgs' +down_revision = '0071_add_job_error_state' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.create_table('dvla_organisation', + sa.Column('id', sa.String(), nullable=False), + sa.Column('name', sa.String(length=255), nullable=True), + sa.PrimaryKeyConstraint('id') + ) + + # insert initial values - HMG and Land Reg + op.execute(""" + INSERT INTO dvla_organisation VALUES + ('001', 'HM Government'), + ('500', 'Land Registry') + """) + + op.add_column('services', sa.Column('dvla_organisation_id', sa.String(), nullable=True, server_default='001')) + op.add_column('services_history', sa.Column('dvla_organisation_id', sa.String(), nullable=True, server_default='001')) + + # set everything to be HMG for now + op.execute("UPDATE services SET dvla_organisation_id = '001'") + op.execute("UPDATE services_history SET dvla_organisation_id = '001'") + + op.alter_column('services', 'dvla_organisation_id', nullable=False) + op.alter_column('services_history', 'dvla_organisation_id', nullable=False) + + op.create_index( + op.f('ix_services_dvla_organisation_id'), + 'services', + ['dvla_organisation_id'], + unique=False + ) + op.create_index( + op.f('ix_services_history_dvla_organisation_id'), + 'services_history', + ['dvla_organisation_id'], + unique=False + ) + + op.create_foreign_key(None, 'services', 'dvla_organisation', ['dvla_organisation_id'], ['id']) + +def downgrade(): + op.drop_column('services_history', 'dvla_organisation_id') + op.drop_column('services', 'dvla_organisation_id') + op.drop_table('dvla_organisation') diff --git a/migrations/versions/0073_add_international_sms_flag.py b/migrations/versions/0073_add_international_sms_flag.py new file mode 100644 index 000000000..e175d2ed6 --- /dev/null +++ b/migrations/versions/0073_add_international_sms_flag.py @@ -0,0 +1,24 @@ +"""empty message + +Revision ID: 0073_add_international_sms_flag +Revises: 0072_add_dvla_orgs +Create Date: 2017-10-25 17:37:27.660723 + +""" + +# revision identifiers, used by Alembic. +revision = '0073_add_international_sms_flag' +down_revision = '0072_add_dvla_orgs' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + op.add_column('services', sa.Column('can_send_international_sms', sa.Boolean(), nullable=False, server_default=sa.false())) + op.add_column('services_history', sa.Column('can_send_international_sms', sa.Boolean(), nullable=False, server_default=sa.false())) + + +def downgrade(): + op.drop_column('services_history', 'can_send_international_sms') + op.drop_column('services', 'can_send_international_sms') diff --git a/migrations/versions/0074_update_sms_rate.py b/migrations/versions/0074_update_sms_rate.py new file mode 100644 index 000000000..7a5a0728a --- /dev/null +++ b/migrations/versions/0074_update_sms_rate.py @@ -0,0 +1,28 @@ +"""empty message + +Revision ID: 0074_update_sms_rate +Revises: 0073_add_international_sms_flag +Create Date: 2017-04-24 12:10:02.116278 + +""" + +import uuid + +revision = '0074_update_sms_rate' +down_revision = '0073_add_international_sms_flag' + +from alembic import op + + +def upgrade(): + op.get_bind() + op.execute("INSERT INTO provider_rates (id, valid_from, rate, provider_id) " + "VALUES ('{}', '2017-04-01 00:00:00', 1.58, " + "(SELECT id FROM provider_details WHERE identifier = 'mmg'))".format(uuid.uuid4()) + ) + + +def downgrade(): + op.get_bind() + op.execute("DELETE FROM provider_rates where valid_from = '2017-04-01 00:00:00' " + "and provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg')") \ No newline at end of file diff --git a/migrations/versions/0075_create_rates_table.py b/migrations/versions/0075_create_rates_table.py new file mode 100644 index 000000000..056330b79 --- /dev/null +++ b/migrations/versions/0075_create_rates_table.py @@ -0,0 +1,40 @@ +"""empty message + +Revision ID: 0075_create_rates_table +Revises: 0074_update_sms_rate +Create Date: 2017-04-24 15:12:18.907629 + +""" + +# revision identifiers, used by Alembic. +import uuid + +revision = '0075_create_rates_table' +down_revision = '0074_update_sms_rate' + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +def upgrade(): + notification_types = postgresql.ENUM('email', 'sms', 'letter', name='notification_type', create_type=False) + op.create_table('rates', + sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False), + sa.Column('valid_from', sa.DateTime(), nullable=False), + sa.Column('rate', sa.Numeric(), nullable=False), + sa.Column('notification_type', notification_types, nullable=False), + sa.PrimaryKeyConstraint('id') + ) + + op.create_index(op.f('ix_rates_notification_type'), 'rates', ['notification_type'], unique=False) + + op.get_bind() + op.execute("INSERT INTO rates(id, valid_from, rate, notification_type) " + "VALUES('{}', '2016-05-18 00:00:00', 1.65, 'sms')".format(uuid.uuid4())) + op.execute("INSERT INTO rates(id, valid_from, rate, notification_type) " + "VALUES('{}', '2017-04-01 00:00:00', 1.58, 'sms')".format(uuid.uuid4())) + + +def downgrade(): + op.drop_index(op.f('ix_rates_notification_type'), table_name='rates') + op.drop_table('rates') diff --git a/tests/app/celery/test_tasks.py b/tests/app/celery/test_tasks.py index 0a960329b..8b9631b4f 100644 --- a/tests/app/celery/test_tasks.py +++ b/tests/app/celery/test_tasks.py @@ -1038,15 +1038,14 @@ def test_create_dvla_file_contents(sample_letter_template, mocker): assert calls[1][1]['contact_block'] == 'London,\nSW1A 1AA' assert calls[0][1]['notification_reference'] == '1' assert calls[1][1]['notification_reference'] == '2' + assert calls[1][1]['org_id'] == '001' @freeze_time("2017-03-23 11:09:00.061258") def test_dvla_letter_template(sample_letter_notification): t = {"content": sample_letter_notification.template.content, "subject": sample_letter_notification.template.subject} - letter = LetterDVLATemplate(t, - sample_letter_notification.personalisation, - "random-string") + letter = LetterDVLATemplate(t, sample_letter_notification.personalisation, "random-string") assert str(letter) == "140|500|001||random-string|||||||||||||A1||A2|A3|A4|A5|A6|A_POST|||||||||23 March 2017

Template subjectDear Sir/Madam, Hello. Yours Truly, The Government." # noqa diff --git a/tests/app/dao/test_provider_details_dao.py b/tests/app/dao/test_provider_details_dao.py index 51339370c..5092bd1b9 100644 --- a/tests/app/dao/test_provider_details_dao.py +++ b/tests/app/dao/test_provider_details_dao.py @@ -273,3 +273,12 @@ def test_get_sms_provider_with_equal_priority_returns_provider( dao_get_sms_provider_with_equal_priority(current_provider.identifier, current_provider.priority) assert conflicting_provider + + +def test_get_current_sms_provider_returns_active_only(restore_provider_details): + current_provider = get_current_provider('sms') + current_provider.active = False + dao_update_provider_details(current_provider) + new_current_provider = get_current_provider('sms') + + assert current_provider.identifier != new_current_provider.identifier diff --git a/tests/app/dao/test_rates_dao.py b/tests/app/dao/test_rates_dao.py new file mode 100644 index 000000000..33f68a671 --- /dev/null +++ b/tests/app/dao/test_rates_dao.py @@ -0,0 +1,18 @@ +from datetime import datetime + +from decimal import Decimal + +from app.dao.rates_dao import get_rate_for_type_and_date + + +def test_get_rate_for_type_and_date(notify_db): + rate = get_rate_for_type_and_date('sms', datetime.utcnow()) + assert rate.rate == Decimal("1.58") + + rate = get_rate_for_type_and_date('sms', datetime(2016, 6, 1)) + assert rate.rate == Decimal("1.65") + + +def test_get_rate_for_type_and_date_early_date(notify_db): + rate = get_rate_for_type_and_date('sms', datetime(2014, 6, 1)) + assert not rate diff --git a/tests/app/dao/test_services_dao.py b/tests/app/dao/test_services_dao.py index 1b90a8539..d37f8341b 100644 --- a/tests/app/dao/test_services_dao.py +++ b/tests/app/dao/test_services_dao.py @@ -43,6 +43,7 @@ from app.models import ( InvitedUser, Service, BRANDING_GOVUK, + DVLA_ORG_HM_GOVERNMENT, KEY_TYPE_NORMAL, KEY_TYPE_TEAM, KEY_TYPE_TEST @@ -77,6 +78,7 @@ def test_create_service(sample_user): assert service_db.name == "service_name" assert service_db.id == service.id assert service_db.branding == BRANDING_GOVUK + assert service_db.dvla_organisation_id == DVLA_ORG_HM_GOVERNMENT assert service_db.research_mode is False assert service.active is True assert sample_user in service_db.users @@ -263,7 +265,9 @@ def test_create_service_creates_a_history_record_with_current_data(sample_user): assert sample_user.id == service_history.created_by_id assert service_from_db.created_by.id == service_history.created_by_id assert service_from_db.branding == BRANDING_GOVUK + assert service_from_db.dvla_organisation_id == DVLA_ORG_HM_GOVERNMENT assert service_history.branding == BRANDING_GOVUK + assert service_history.dvla_organisation_id == DVLA_ORG_HM_GOVERNMENT def test_update_service_creates_a_history_record_with_current_data(sample_user): diff --git a/tests/app/dvla_organisation/__init__.py b/tests/app/dvla_organisation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/app/dvla_organisation/test_rest.py b/tests/app/dvla_organisation/test_rest.py new file mode 100644 index 000000000..e40c843bf --- /dev/null +++ b/tests/app/dvla_organisation/test_rest.py @@ -0,0 +1,13 @@ +from flask import json + +from tests import create_authorization_header + + +def test_get_dvla_organisations(client): + auth_header = create_authorization_header() + + response = client.get('/dvla_organisations', headers=[auth_header]) + + assert response.status_code == 200 + dvla_organisations = json.loads(response.get_data(as_text=True)) + assert dvla_organisations == {'001': 'HM Government', '500': 'Land Registry'} diff --git a/tests/app/service/test_rest.py b/tests/app/service/test_rest.py index 846d461b9..43edbc040 100644 --- a/tests/app/service/test_rest.py +++ b/tests/app/service/test_rest.py @@ -10,7 +10,7 @@ from freezegun import freeze_time from app.dao.users_dao import save_model_user from app.dao.services_dao import dao_remove_user_from_service -from app.models import User, Organisation +from app.models import User, Organisation, DVLA_ORG_LAND_REGISTRY from tests import create_authorization_header from tests.app.conftest import ( sample_service as create_service, @@ -129,21 +129,20 @@ def test_get_service_list_should_return_empty_list_if_no_services(notify_api, no assert len(json_resp['data']) == 0 -def test_get_service_by_id(notify_api, sample_service): - with notify_api.test_request_context(): - with notify_api.test_client() as client: - auth_header = create_authorization_header() - resp = client.get( - '/service/{}'.format(sample_service.id), - headers=[auth_header] - ) - assert resp.status_code == 200 - json_resp = json.loads(resp.get_data(as_text=True)) - assert json_resp['data']['name'] == sample_service.name - assert json_resp['data']['id'] == str(sample_service.id) - assert not json_resp['data']['research_mode'] - assert json_resp['data']['organisation'] is None - assert json_resp['data']['branding'] == 'govuk' +def test_get_service_by_id(client, sample_service): + auth_header = create_authorization_header() + resp = client.get( + '/service/{}'.format(sample_service.id), + headers=[auth_header] + ) + assert resp.status_code == 200 + json_resp = json.loads(resp.get_data(as_text=True)) + assert json_resp['data']['name'] == sample_service.name + assert json_resp['data']['id'] == str(sample_service.id) + assert not json_resp['data']['research_mode'] + assert json_resp['data']['organisation'] is None + assert json_resp['data']['branding'] == 'govuk' + assert json_resp['data']['dvla_organisation'] == '001' def test_get_service_by_id_should_404_if_no_service(notify_api, notify_db): @@ -191,41 +190,40 @@ def test_get_service_by_id_should_404_if_no_service_for_user(notify_api, sample_ assert json_resp['message'] == 'No result found' -def test_create_service(notify_api, sample_user): - with notify_api.test_request_context(): - with notify_api.test_client() as client: - data = { - 'name': 'created service', - 'user_id': str(sample_user.id), - 'message_limit': 1000, - 'restricted': False, - 'active': False, - 'email_from': 'created.service', - 'created_by': str(sample_user.id)} - auth_header = create_authorization_header() - headers = [('Content-Type', 'application/json'), auth_header] - resp = client.post( - '/service', - data=json.dumps(data), - headers=headers) - json_resp = json.loads(resp.get_data(as_text=True)) - assert resp.status_code == 201 - assert json_resp['data']['id'] - assert json_resp['data']['name'] == 'created service' - assert json_resp['data']['email_from'] == 'created.service' - assert not json_resp['data']['research_mode'] +def test_create_service(client, sample_user): + data = { + 'name': 'created service', + 'user_id': str(sample_user.id), + 'message_limit': 1000, + 'restricted': False, + 'active': False, + 'email_from': 'created.service', + 'created_by': str(sample_user.id)} + auth_header = create_authorization_header() + headers = [('Content-Type', 'application/json'), auth_header] + resp = client.post( + '/service', + data=json.dumps(data), + headers=headers) + json_resp = json.loads(resp.get_data(as_text=True)) + assert resp.status_code == 201 + assert json_resp['data']['id'] + assert json_resp['data']['name'] == 'created service' + assert json_resp['data']['email_from'] == 'created.service' + assert not json_resp['data']['research_mode'] + assert json_resp['data']['dvla_organisation'] == '001' - auth_header_fetch = create_authorization_header() + auth_header_fetch = create_authorization_header() - resp = client.get( - '/service/{}?user_id={}'.format(json_resp['data']['id'], sample_user.id), - headers=[auth_header_fetch] - ) - assert resp.status_code == 200 - json_resp = json.loads(resp.get_data(as_text=True)) - assert json_resp['data']['name'] == 'created service' - assert not json_resp['data']['research_mode'] - assert not json_resp['data']['can_send_letters'] + resp = client.get( + '/service/{}?user_id={}'.format(json_resp['data']['id'], sample_user.id), + headers=[auth_header_fetch] + ) + assert resp.status_code == 200 + json_resp = json.loads(resp.get_data(as_text=True)) + assert json_resp['data']['name'] == 'created service' + assert not json_resp['data']['research_mode'] + assert not json_resp['data']['can_send_letters'] def test_should_not_create_service_with_missing_user_id_field(notify_api, fake_uuid): @@ -371,41 +369,41 @@ def test_create_service_should_throw_duplicate_key_constraint_for_existing_email assert "Duplicate service name '{}'".format(service_name) in json_resp['message']['name'] -def test_update_service(notify_api, notify_db, sample_service): +def test_update_service(client, notify_db, sample_service): org = Organisation(colour='#000000', logo='justice-league.png', name='Justice League') notify_db.session.add(org) notify_db.session.commit() - with notify_api.test_request_context(): - with notify_api.test_client() as client: - auth_header = create_authorization_header() - resp = client.get( - '/service/{}'.format(sample_service.id), - headers=[auth_header] - ) - json_resp = json.loads(resp.get_data(as_text=True)) - assert resp.status_code == 200 - assert json_resp['data']['name'] == sample_service.name + auth_header = create_authorization_header() + resp = client.get( + '/service/{}'.format(sample_service.id), + headers=[auth_header] + ) + json_resp = json.loads(resp.get_data(as_text=True)) + assert resp.status_code == 200 + assert json_resp['data']['name'] == sample_service.name - data = { - 'name': 'updated service name', - 'email_from': 'updated.service.name', - 'created_by': str(sample_service.created_by.id), - 'organisation': str(org.id) - } + data = { + 'name': 'updated service name', + 'email_from': 'updated.service.name', + 'created_by': str(sample_service.created_by.id), + 'organisation': str(org.id), + 'dvla_organisation': DVLA_ORG_LAND_REGISTRY + } - auth_header = create_authorization_header() + auth_header = create_authorization_header() - resp = client.post( - '/service/{}'.format(sample_service.id), - data=json.dumps(data), - headers=[('Content-Type', 'application/json'), auth_header] - ) - result = json.loads(resp.get_data(as_text=True)) - assert resp.status_code == 200 - assert result['data']['name'] == 'updated service name' - assert result['data']['email_from'] == 'updated.service.name' - assert result['data']['organisation'] == str(org.id) + resp = client.post( + '/service/{}'.format(sample_service.id), + data=json.dumps(data), + headers=[('Content-Type', 'application/json'), auth_header] + ) + result = json.loads(resp.get_data(as_text=True)) + assert resp.status_code == 200 + assert result['data']['name'] == 'updated service name' + assert result['data']['email_from'] == 'updated.service.name' + assert result['data']['organisation'] == str(org.id) + assert result['data']['dvla_organisation'] == DVLA_ORG_LAND_REGISTRY def test_update_service_flags(notify_api, sample_service): diff --git a/tests/conftest.py b/tests/conftest.py index 41fec2d91..c7ec7ee3b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -75,7 +75,9 @@ def notify_db_session(notify_db): "branding_type", "job_status", "provider_details_history", - "template_process_type"]: + "template_process_type", + "dvla_organisation", + "rates"]: notify_db.engine.execute(tbl.delete()) notify_db.session.commit()