This commit is contained in:
Kenneth Kehl
2023-08-15 11:44:47 -07:00
parent fbf2f99d7b
commit c5008da8df
3 changed files with 8 additions and 10 deletions

View File

@@ -139,8 +139,6 @@ def purge_functional_test_data(user_email_prefix):
print(f"Deleting user {usr.id} which is not part of any services")
delete_user_verify_codes(usr)
delete_model_user(usr)
raise Exception(f"RAN with user {usr}")
raise Exception("NO USERS")
@notify_command(name='insert-inbound-numbers')
@@ -256,7 +254,7 @@ def bulk_invite_user_to_service(file_name, service_id, user_id, auth_type, permi
@click.option('-e', '--end_date', required=True, help="end date inclusive", type=click_dt(format='%Y-%m-%d'))
def update_jobs_archived_flag(start_date, end_date):
print('Archiving jobs created between {} to {}'.format(start_date, end_date))
current_app.logger.info('Archiving jobs created between {} to {}'.format(start_date, end_date))
process_date = start_date
total_updated = 0

View File

@@ -106,7 +106,7 @@ class UserSchema(BaseSchema):
permissions = fields.Method("user_permissions", dump_only=True)
password_changed_at = field_for(models.User, 'password_changed_at', format=DATETIME_FORMAT_NO_TIMEZONE)
created_at = field_for(models.User, 'created_at', format=DATETIME_FORMAT_NO_TIMEZONE)
updated_atx = FlexibleDateTime()
updated_at = FlexibleDateTime()
logged_in_at = FlexibleDateTime()
auth_type = field_for(models.User, 'auth_type')
password = fields.String(required=True, load_only=True)

View File

@@ -63,7 +63,7 @@ def test_purge_functional_test_data_bad_mobile(notify_db_session, notify_api):
user_count = User.query.count()
assert user_count == 0
# run the command
x = notify_api.test_cli_runner().invoke(
command_response = notify_api.test_cli_runner().invoke(
create_test_user, [
'--email', 'somebody+7af2cdb0-7cbc-44dc-a5d0-f817fc6ee94e@fake.gov',
'--mobile_number', '555-555-55554444',
@@ -72,7 +72,7 @@ def test_purge_functional_test_data_bad_mobile(notify_db_session, notify_api):
]
)
# The bad mobile phone number results in a bad parameter error, leading to a system exit 2 and no entry made in db
assert "SystemExit(2)" in str(x)
assert "SystemExit(2)" in str(command_response)
user_count = User.query.count()
assert user_count == 0
@@ -115,14 +115,14 @@ def test_populate_organizations_from_file(notify_db_session, notify_api):
f = open(file_name, "a")
f.write(text)
f.close()
x = notify_api.test_cli_runner().invoke(
command_response = notify_api.test_cli_runner().invoke(
populate_organizations_from_file, [
'-f', file_name
]
)
os.remove(file_name)
print(f"X = {x}")
print(f"command_response = {command_response}")
org_count = Organization.query.count()
assert org_count == 1
@@ -146,12 +146,12 @@ def test_populate_organization_agreement_details_from_file(notify_db_session, no
f = open(file_name, "a")
f.write(text)
f.close()
x = notify_api.test_cli_runner().invoke(
command_response = notify_api.test_cli_runner().invoke(
populate_organization_agreement_details_from_file, [
'-f', file_name
]
)
print(f"X = {x}")
print(f"command_response = {command_response}")
org_count = Organization.query.count()
assert org_count == 1