From ed69df44032c5b9911640e25ec3b30f238d3b46e Mon Sep 17 00:00:00 2001 From: Thorrak Date: Thu, 26 Nov 2020 11:23:46 -0500 Subject: [PATCH] Change test to iterate through messages instead of accessing _queued_messages directly --- .../{{cookiecutter.project_slug}}/users/tests/test_views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py index 23d4ab3c..52d14606 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_views.py @@ -61,7 +61,11 @@ class TestUserUpdateView: form.cleaned_data = [] view.form_valid(form) - assert messages.get_messages(request)._queued_messages[0].message == "Information successfully updated" + found_message = False + for message in messages.get_messages(request): + assert message.message == "Information successfully updated" + found_message = True + assert found_message class TestUserRedirectView: