mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-28 03:11:40 -05:00
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,6 +5,7 @@ __pycache__/
|
||||
*.py[cod]
|
||||
|
||||
venv/
|
||||
venv-freeze/
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
@@ -135,14 +135,15 @@ def get_letter_pdf(notification):
|
||||
s3 = boto3.resource('s3')
|
||||
bucket = s3.Bucket(bucket_name)
|
||||
|
||||
for item in bucket.objects.filter(Prefix=get_bucket_prefix_for_notification(notification, is_test_letter)):
|
||||
obj = s3.Object(
|
||||
bucket_name=bucket_name,
|
||||
key=item.key
|
||||
)
|
||||
file_content = obj.get()["Body"].read()
|
||||
item = next(x for x in bucket.objects.filter(
|
||||
Prefix=get_bucket_prefix_for_notification(notification, is_test_letter)
|
||||
))
|
||||
|
||||
return file_content
|
||||
obj = s3.Object(
|
||||
bucket_name=bucket_name,
|
||||
key=item.key
|
||||
)
|
||||
return obj.get()["Body"].read()
|
||||
|
||||
|
||||
def _move_s3_object(source_bucket, source_filename, target_bucket, target_filename):
|
||||
|
||||
@@ -5,7 +5,7 @@ cffi==1.11.5
|
||||
celery==3.1.26.post2 # pyup: <4
|
||||
docopt==0.6.2
|
||||
Flask-Bcrypt==0.7.1
|
||||
flask-marshmallow==0.8.0
|
||||
flask-marshmallow==0.9.0
|
||||
Flask-Migrate==2.2.1
|
||||
Flask-SQLAlchemy==2.3.2
|
||||
Flask==1.0.2
|
||||
@@ -15,16 +15,16 @@ gunicorn==19.7.1
|
||||
iso8601==0.1.12
|
||||
jsonschema==2.6.0
|
||||
marshmallow-sqlalchemy==0.14.0
|
||||
marshmallow==2.15.3
|
||||
marshmallow==2.15.4
|
||||
psycopg2-binary==2.7.5
|
||||
PyJWT==1.6.4
|
||||
SQLAlchemy==1.2.9
|
||||
SQLAlchemy==1.2.10
|
||||
|
||||
notifications-python-client==4.8.2
|
||||
notifications-python-client==5.0.0
|
||||
|
||||
# PaaS
|
||||
awscli-cwlogs>=1.4,<1.5
|
||||
|
||||
git+https://github.com/alphagov/notifications-utils.git@29.3.4#egg=notifications-utils==29.3.4
|
||||
git+https://github.com/alphagov/notifications-utils.git@29.3.5#egg=notifications-utils==29.3.5
|
||||
|
||||
git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3
|
||||
|
||||
@@ -7,7 +7,7 @@ cffi==1.11.5
|
||||
celery==3.1.26.post2 # pyup: <4
|
||||
docopt==0.6.2
|
||||
Flask-Bcrypt==0.7.1
|
||||
flask-marshmallow==0.8.0
|
||||
flask-marshmallow==0.9.0
|
||||
Flask-Migrate==2.2.1
|
||||
Flask-SQLAlchemy==2.3.2
|
||||
Flask==1.0.2
|
||||
@@ -17,17 +17,17 @@ gunicorn==19.7.1
|
||||
iso8601==0.1.12
|
||||
jsonschema==2.6.0
|
||||
marshmallow-sqlalchemy==0.14.0
|
||||
marshmallow==2.15.3
|
||||
marshmallow==2.15.4
|
||||
psycopg2-binary==2.7.5
|
||||
PyJWT==1.6.4
|
||||
SQLAlchemy==1.2.9
|
||||
SQLAlchemy==1.2.10
|
||||
|
||||
notifications-python-client==4.8.2
|
||||
notifications-python-client==5.0.0
|
||||
|
||||
# PaaS
|
||||
awscli-cwlogs>=1.4,<1.5
|
||||
|
||||
git+https://github.com/alphagov/notifications-utils.git@29.3.4#egg=notifications-utils==29.3.4
|
||||
git+https://github.com/alphagov/notifications-utils.git@29.3.5#egg=notifications-utils==29.3.5
|
||||
|
||||
git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3
|
||||
|
||||
@@ -35,12 +35,12 @@ git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3
|
||||
alembic==1.0.0
|
||||
amqp==1.4.9
|
||||
anyjson==0.3.3
|
||||
awscli==1.15.70
|
||||
awscli==1.15.74
|
||||
bcrypt==3.1.4
|
||||
billiard==3.3.0.23
|
||||
bleach==2.1.3
|
||||
boto3==1.6.16
|
||||
botocore==1.10.69
|
||||
botocore==1.10.73
|
||||
certifi==2018.4.16
|
||||
chardet==3.0.4
|
||||
click==6.7
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
-r requirements.txt
|
||||
flake8==3.5.0
|
||||
moto==1.3.3
|
||||
pytest==3.6.3
|
||||
pytest==3.7.1
|
||||
pytest-env==0.6.2
|
||||
pytest-mock==1.10.0
|
||||
pytest-cov==2.5.1
|
||||
pytest-xdist==1.22.2
|
||||
pytest-xdist==1.22.5
|
||||
coveralls==1.3.0
|
||||
freezegun==0.3.10
|
||||
requests-mock==1.5.0
|
||||
requests-mock==1.5.2
|
||||
# optional requirements for jsonschema
|
||||
strict-rfc3339==0.7
|
||||
rfc3987==1.3.7
|
||||
rfc3987==1.3.8
|
||||
|
||||
@@ -21,13 +21,13 @@ FROZEN_DATE_TIME = "2018-03-14 17:00:00"
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
@freeze_time(FROZEN_DATE_TIME)
|
||||
def sample_precompiled_letter_notification_using_test_key(sample_letter_notification):
|
||||
sample_letter_notification.template.hidden = True
|
||||
sample_letter_notification.template.name = PRECOMPILED_TEMPLATE_NAME
|
||||
sample_letter_notification.key_type = KEY_TYPE_TEST
|
||||
sample_letter_notification.reference = 'foo'
|
||||
sample_letter_notification.created_at = datetime.utcnow()
|
||||
with freeze_time(FROZEN_DATE_TIME):
|
||||
sample_letter_notification.created_at = datetime.utcnow()
|
||||
return sample_letter_notification
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user