Skip to content

Commit

Permalink
Improve the template_source view coverage a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Oct 22, 2022
1 parent 62f9bc4 commit a8fa1d0
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_integration.py
Expand Up @@ -269,6 +269,26 @@ def test_template_source_checks_show_toolbar(self):
)
self.assertEqual(response.status_code, 404)

def test_template_source_errors(self):
url = "/__debug__/template_source/"

response = self.client.get(url, {})
self.assertContains(
response, '"template_origin" key is required', status_code=400
)

template = get_template("basic.html")
response = self.client.get(
url,
{"template_origin": signing.dumps(template.template.origin.name) + "xyz"},
)
self.assertContains(response, '"template_origin" is invalid', status_code=400)

response = self.client.get(
url, {"template_origin": signing.dumps("does_not_exist.html")}
)
self.assertContains(response, "Template Does Not Exist: does_not_exist.html")

def test_sql_select_checks_show_toolbar(self):
url = "/__debug__/sql_select/"
data = {
Expand Down

0 comments on commit a8fa1d0

Please sign in to comment.