I made an inline comment, plus I notice there are no tests for this and I'm wondering if it's worth somehow testing it. Perhaps checking that the context has no "archive" value, then creating an Archive and checking again, this time that the context has the archive attribute.
I found a possibly related snippet in archives/tests/test_helpers.py, that may prove helpful.
It may also be possible to do a test where we actually verify that the rendered template has the warning string if there's no archive.
Apologies if this is vague, it's just showing my incomplete knowledge of django templates and testing :/
I made an inline comment, plus I notice there are no tests for this and I'm wondering if it's worth somehow testing it. Perhaps checking that the context has no "archive" value, then creating an Archive and checking again, this time that the context has the archive attribute.
I found a possibly related snippet in archives/ tests/test_ helpers. py, that may prove helpful.
It may also be possible to do a test where we actually verify that the rendered template has the warning string if there's no archive.
Apologies if this is vague, it's just showing my incomplete knowledge of django templates and testing :/