【发布时间】:2022-07-01 21:10:13
【问题描述】:
我在这里创建一个条目,该条目采用 HTML 文件输入。现在我正在尝试使用以下代码,但获得权限被拒绝。如何在我的测试用例中引用该 HTML 模板。
# CREATE EMAIL TEMPLATE
data = {
"user":user,
"platform_subscriber":project,
"name": "TESTCASE TEMPLATE",
"html_template": "../nice.html"
}
email_template, created = EmailTemplate.objects.custom_get_or_create(data)
print("The key",email_template)
self.email_template = email_template.id
日志:
aise SuspiciousOperation("Attempted access to '%s' denied." % name)
django.core.exceptions.SuspiciousOperation: Attempted access to '../nice.html' denied.
【问题讨论】:
标签: python django django-models django-rest-framework django-views