diff --git a/app/commands.py b/app/commands.py index c2a2d70e7..2e21c0518 100644 --- a/app/commands.py +++ b/app/commands.py @@ -664,7 +664,10 @@ def populate_annual_billing_with_the_previous_years_allowance(year): def dump_user_info(user_email_address): user = get_user_by_email(user_email_address) content = user.serialize() - click.echo(content) + with open("user_download.json", "wb") as f: + f.write(json.dumps(content).encode("utf8")) + f.close() + print("Successfully downloaded user info to user_download.json") @notify_command(name="populate-annual-billing-with-defaults") diff --git a/tests/app/delivery/test_send_to_providers.py b/tests/app/delivery/test_send_to_providers.py index 7f16a799a..63ab31ec7 100644 --- a/tests/app/delivery/test_send_to_providers.py +++ b/tests/app/delivery/test_send_to_providers.py @@ -330,7 +330,7 @@ def test_should_send_sms_with_downgraded_content(notify_db_session, mocker): template=template, ) db_notification.personalisation = {"misc": placeholder} - db_notification.reply_to_text = 'testing' + db_notification.reply_to_text = "testing" mocker.patch("app.aws_sns_client.send_sms") @@ -622,7 +622,7 @@ def test_should_update_billable_units_and_status_according_to_research_mode_and_ billable_units=0, status=NotificationStatus.CREATED, key_type=key_type, - reply_to_text='testing', + reply_to_text="testing", ) mocker.patch("app.aws_sns_client.send_sms") mocker.patch( @@ -786,7 +786,10 @@ def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_te ) send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+12028675309", normalised_to="2028675309", reply_to_text='testing' + template=sample_template, + to_field="+12028675309", + normalised_to="2028675309", + reply_to_text="testing", ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") @@ -862,7 +865,10 @@ def test_send_sms_to_provider_should_return_template_if_found_in_redis( send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+447700900855", normalised_to="447700900855", reply_to_text='testing' + template=sample_template, + to_field="+447700900855", + normalised_to="447700900855", + reply_to_text="testing", ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3")