mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-17 23:34:05 -04:00
Merge pull request #1531 from alphagov/reqs-txt
update requirements.txt
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
boto3==1.4.8
|
||||
boto3==1.5.6
|
||||
cffi==1.11.0 # pyup: != 1.11.1, != 1.11.2 # These versions are missing .whl
|
||||
celery==3.1.25 # pyup: <4
|
||||
docopt==0.6.2
|
||||
@@ -17,18 +17,14 @@ monotonic==1.4
|
||||
psycopg2==2.7.3.2
|
||||
PyJWT==1.5.3
|
||||
SQLAlchemy-Utils==0.32.21
|
||||
SQLAlchemy==1.1.15
|
||||
statsd==3.2.1
|
||||
SQLAlchemy==1.2.0
|
||||
|
||||
notifications-python-client==4.6.0
|
||||
notifications-python-client==4.7.1
|
||||
|
||||
# PaaS
|
||||
awscli==1.14.4
|
||||
awscli==1.14.16
|
||||
awscli-cwlogs>=1.4,<1.5
|
||||
|
||||
git+https://github.com/alphagov/notifications-utils.git@23.3.4#egg=notifications-utils==23.3.4
|
||||
git+https://github.com/alphagov/notifications-utils.git@23.3.5#egg=notifications-utils==23.3.5
|
||||
|
||||
git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3
|
||||
|
||||
# required by utils
|
||||
git+https://github.com/leohemsted/smartypants.py.git@regex-speedup#egg=smartypants==2.1.0
|
||||
|
||||
@@ -3,7 +3,7 @@ flake8==3.5.0
|
||||
pytest==3.3.1
|
||||
pytest-mock==1.6.3
|
||||
pytest-cov==2.5.1
|
||||
pytest-xdist==1.20.1
|
||||
pytest-xdist==1.21.0
|
||||
coveralls==1.2.0
|
||||
freezegun==0.3.9
|
||||
requests-mock==1.4.0
|
||||
|
||||
@@ -57,8 +57,7 @@ from tests.app.db import (
|
||||
create_service,
|
||||
create_api_key,
|
||||
create_inbound_number,
|
||||
create_letter_contact,
|
||||
create_inbound_sms,
|
||||
create_letter_contact
|
||||
)
|
||||
|
||||
|
||||
@@ -649,16 +648,6 @@ def sample_email_notification(notify_db, notify_db_session):
|
||||
return notification
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_statsd_inc(mocker):
|
||||
return mocker.patch('app.statsd_client.incr')
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def mock_statsd_timing(mocker):
|
||||
return mocker.patch('app.statsd_client.timing')
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def sample_notification_history(
|
||||
notify_db,
|
||||
@@ -1048,18 +1037,13 @@ def sample_provider_rate(notify_db, notify_db_session, valid_from=None, rate=Non
|
||||
@pytest.fixture
|
||||
def sample_inbound_numbers(notify_db, notify_db_session, sample_service):
|
||||
service = create_service(service_name='sample service 2')
|
||||
inbound_numbers = []
|
||||
inbound_numbers = list()
|
||||
inbound_numbers.append(create_inbound_number(number='1', provider='mmg'))
|
||||
inbound_numbers.append(create_inbound_number(number='2', provider='mmg', active=False, service_id=service.id))
|
||||
inbound_numbers.append(create_inbound_number(number='3', provider='firetext', service_id=sample_service.id))
|
||||
return inbound_numbers
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def sample_inbound_sms(notify_db, notify_db_session, sample_service):
|
||||
return create_inbound_sms(sample_service)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def restore_provider_details(notify_db, notify_db_session):
|
||||
"""
|
||||
|
||||
@@ -90,25 +90,28 @@ def test_should_not_delete_inbound_sms_before_seven_days(sample_service):
|
||||
assert len(InboundSms.query.all()) == 2
|
||||
|
||||
|
||||
def test_get_inbound_sms_by_id_returns(sample_inbound_sms):
|
||||
inbound_from_db = dao_get_inbound_sms_by_id(sample_inbound_sms.service.id, sample_inbound_sms.id)
|
||||
def test_get_inbound_sms_by_id_returns(sample_service):
|
||||
inbound_sms = create_inbound_sms(service=sample_service)
|
||||
inbound_from_db = dao_get_inbound_sms_by_id(inbound_sms.service.id, inbound_sms.id)
|
||||
|
||||
assert sample_inbound_sms == inbound_from_db
|
||||
assert inbound_sms == inbound_from_db
|
||||
|
||||
|
||||
def test_dao_get_paginated_inbound_sms_for_service(sample_inbound_sms):
|
||||
inbound_from_db = dao_get_paginated_inbound_sms_for_service(sample_inbound_sms.service.id)
|
||||
def test_dao_get_paginated_inbound_sms_for_service(sample_service):
|
||||
inbound_sms = create_inbound_sms(service=sample_service)
|
||||
inbound_from_db = dao_get_paginated_inbound_sms_for_service(inbound_sms.service.id)
|
||||
|
||||
assert sample_inbound_sms == inbound_from_db[0]
|
||||
assert inbound_sms == inbound_from_db[0]
|
||||
|
||||
|
||||
def test_dao_get_paginated_inbound_sms_for_service_return_only_for_service(sample_inbound_sms):
|
||||
def test_dao_get_paginated_inbound_sms_for_service_return_only_for_service(sample_service):
|
||||
inbound_sms = create_inbound_sms(service=sample_service)
|
||||
another_service = create_service(service_name='another service')
|
||||
another_inbound_sms = create_inbound_sms(another_service)
|
||||
|
||||
inbound_from_db = dao_get_paginated_inbound_sms_for_service(sample_inbound_sms.service.id)
|
||||
inbound_from_db = dao_get_paginated_inbound_sms_for_service(inbound_sms.service.id)
|
||||
|
||||
assert sample_inbound_sms in inbound_from_db
|
||||
assert inbound_sms in inbound_from_db
|
||||
assert another_inbound_sms not in inbound_from_db
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ def create_template(
|
||||
template_name=None,
|
||||
subject='Template subject',
|
||||
content='Dear Sir/Madam, Hello. Yours Truly, The Government.',
|
||||
template_id=None,
|
||||
reply_to=None
|
||||
):
|
||||
data = {
|
||||
|
||||
@@ -97,15 +97,16 @@ def test_get_next_inbound_sms_will_get_correct_inbound_sms_list(client, sample_s
|
||||
_external=True) == json_response['links']['next']
|
||||
|
||||
|
||||
def test_get_next_inbound_sms_at_end_will_return_empty_inbound_sms_list(client, sample_inbound_sms, mocker):
|
||||
def test_get_next_inbound_sms_at_end_will_return_empty_inbound_sms_list(client, sample_service, mocker):
|
||||
inbound_sms = create_inbound_sms(service=sample_service)
|
||||
mocker.patch.dict(
|
||||
"app.v2.inbound_sms.get_inbound_sms.current_app.config",
|
||||
{"API_PAGE_SIZE": 1}
|
||||
)
|
||||
|
||||
auth_header = create_authorization_header(service_id=sample_inbound_sms.service.id)
|
||||
auth_header = create_authorization_header(service_id=inbound_sms.service.id)
|
||||
response = client.get(
|
||||
path=url_for('v2_inbound_sms.get_inbound_sms', older_than=sample_inbound_sms.id),
|
||||
path=url_for('v2_inbound_sms.get_inbound_sms', older_than=inbound_sms.id),
|
||||
headers=[('Content-Type', 'application/json'), auth_header])
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
Reference in New Issue
Block a user