fix purge functional test data task

* it doesn't delete service email reply to or letter contacts, or
  contact lists. I don't think the contact lists will ever be an issue
  but it doesn't hurt to add it to the list of things to remove.
* it doesn't remove users from organisations before deleting the users

there may be more tables that link to Service that should be deleted,
but for now just add these ones that I could spot.
This commit is contained in:
Leo Hemsted
2020-03-30 17:42:59 +01:00
parent c1ba3fb1be
commit 885f3122bd
3 changed files with 17 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ def purge_functional_test_data(user_email_prefix):
"""
Remove non-seeded functional test data
users, services, etc. Give an email prefix. Probably "notify-test-preview".
users, services, etc. Give an email prefix. Probably "notify-tests-preview".
"""
users = User.query.filter(User.email_address.like("{}%".format(user_email_prefix))).all()
for usr in users: