﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
37070	Add .clear_messages() method to django.contrib.messages	benjaoming		"Disclaimer: This is really a minor issue 😊

We can do:

{{{
from django.contrib.messages import get_messages
}}}

And then we can call `get_messages()` - and if we iterate over them, they will be cleared.

But we can't explicitly clear them because this method doesn't exist:

{{{
from django.contrib.messages import clear_messages
}}}

For me, the use-case was test-related: Writing an e2e test case that calls some views and at each step verified messages, then cleared them.

Not sure if adding the method would make people use the messages framework wrongly, but I think it makes sense to note that ADDING `clear_messages` to the mix might make some people think you need to call it... which in most cases, you don't, and therefore the documentation needs to be ''clear'' (pun intended).

Forum discussion: https://forum.djangoproject.com/t/why-isnt-it-easier-to-clear-messages/5727/7"	New feature	new	contrib.messages	dev	Normal				Accepted	0	0	0	0	0	0
