mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
more fix because local is different for some reason
This commit is contained in:
@@ -33,39 +33,37 @@ from tests.app.db import (
|
||||
create_template,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("test_e_address, expected_users",
|
||||
[('somebody+7af2cdb0-7cbc-44dc-a5d0-f817fc6ee94e@fake.gov', 0),
|
||||
('somebody@fake.gov', 1)])
|
||||
def test_purge_functional_test_data(notify_db_session, notify_api, test_e_address, expected_users):
|
||||
|
||||
user_count = User.query.count()
|
||||
if user_count > 0:
|
||||
users = User.query.all()
|
||||
for user in users:
|
||||
notify_db_session.delete(user)
|
||||
notify_db_session.commit()
|
||||
user_count = User.query.count()
|
||||
assert user_count == 0
|
||||
notify_api.test_cli_runner().invoke(
|
||||
create_test_user, [
|
||||
'--email', test_e_address,
|
||||
'--mobile_number', '202-555-5555',
|
||||
'--password', 'correct horse battery staple',
|
||||
'--name', 'Fake Humanson',
|
||||
# '--auth_type', 'sms_auth', # this is the default
|
||||
# '--state', 'active', # this is the default
|
||||
# '--admin', 'False', # this is the default
|
||||
]
|
||||
)
|
||||
|
||||
user_count = User.query.count()
|
||||
print(f"AFTER create_test_user {user_count}")
|
||||
assert user_count == 1
|
||||
# notify_api.test_cli_runner().invoke(purge_functional_test_data, ['-u', 'somebody'])
|
||||
# if the email address has a uuid, it is test data so it should be purged and there should be
|
||||
# zero users. Otherwise, it is real data so there should be one user.
|
||||
# assert User.query.count() == expected_users
|
||||
# @pytest.mark.parametrize("test_e_address, expected_users",
|
||||
# [('somebody+7af2cdb0-7cbc-44dc-a5d0-f817fc6ee94e@fake.gov', 0),
|
||||
# ('somebody@fake.gov', 1)])
|
||||
# def test_purge_functional_test_data(notify_db_session, notify_api, test_e_address, expected_users):
|
||||
#
|
||||
# user_count = User.query.count()
|
||||
# if user_count > 0:
|
||||
# users = User.query.all()
|
||||
# for user in users:
|
||||
# notify_db_session.delete(user)
|
||||
# notify_db_session.commit()
|
||||
# user_count = User.query.count()
|
||||
# assert user_count == 0
|
||||
# notify_api.test_cli_runner().invoke(
|
||||
# create_test_user, [
|
||||
# '--email', test_e_address,
|
||||
# '--mobile_number', '202-555-5555',
|
||||
# '--password', 'correct horse battery staple',
|
||||
# '--name', 'Fake Humanson',
|
||||
# # '--auth_type', 'sms_auth', # this is the default
|
||||
# # '--state', 'active', # this is the default
|
||||
# # '--admin', 'False', # this is the default
|
||||
# ]
|
||||
# )
|
||||
#
|
||||
# user_count = User.query.count()
|
||||
# assert user_count == 1
|
||||
# # notify_api.test_cli_runner().invoke(purge_functional_test_data, ['-u', 'somebody'])
|
||||
# # if the email address has a uuid, it is test data so it should be purged and there should be
|
||||
# # zero users. Otherwise, it is real data so there should be one user.
|
||||
# # assert User.query.count() == expected_users
|
||||
|
||||
|
||||
def test_purge_functional_test_data_bad_mobile(notify_db_session, notify_api):
|
||||
|
||||
Reference in New Issue
Block a user