Marijke Luttekes on Nostr: I just posted this question in the testing channel of the Django Discord, but for ...
I just posted this question in the testing channel of the Django Discord, but for those who are not there:
Does anyone know if you can test if the output of the `{% url %}` template tag is an empty string?
I already have `FAIL_INVALID_TEMPLATE_VARS` enabled in `pytest-django` (which activate Django core's `string_if_invalid`).
While this feature fails tests when template variables are missing, it does nothing for variables with empty values.
#Django
Published at
2024-10-21 12:29:43 UTCEvent JSON
{
"id": "74d53e9f60da17cff65c36592bb51bd4dcd62772b08a9d6c2b9cd9e4fc0e7657",
"pubkey": "6f5b6fead460beb6b46fec8bf096ea243c01becbdfc3d663aa7d485e7d8e50c5",
"created_at": 1729513783,
"kind": 1,
"tags": [
[
"t",
"django"
],
[
"proxy",
"https://fosstodon.org/@mahryekuh/113345415337011168",
"web"
],
[
"proxy",
"https://fosstodon.org/users/mahryekuh/statuses/113345415337011168",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/mahryekuh/statuses/113345415337011168",
"pink.momostr"
],
[
"-"
]
],
"content": "I just posted this question in the testing channel of the Django Discord, but for those who are not there:\n\nDoes anyone know if you can test if the output of the `{% url %}` template tag is an empty string?\n\nI already have `FAIL_INVALID_TEMPLATE_VARS` enabled in `pytest-django` (which activate Django core's `string_if_invalid`).\n\nWhile this feature fails tests when template variables are missing, it does nothing for variables with empty values.\n\n#Django",
"sig": "b2b9a4aa7c3cc42a6e537d4c0fae31dae2191712fdb059ee56329e575e9589dad4d26b78afe980615c4708b3966138f8676fa33d57f9bd24c128b815148e74e7"
}