Fix formatting
This commit is contained in:
@@ -12,35 +12,33 @@ from wtforms import Form
|
||||
|
||||
from atst.filters import iconSvg
|
||||
|
||||
env = Environment(loader=FileSystemLoader('templates'))
|
||||
env = Environment(loader=FileSystemLoader("templates"))
|
||||
|
||||
env.filters['iconSvg'] = iconSvg
|
||||
env.filters["iconSvg"] = iconSvg
|
||||
|
||||
# override tojson as identity function to prevent
|
||||
# wrapping strings in extra quotes
|
||||
env.filters['tojson'] = lambda x: x
|
||||
env.filters["tojson"] = lambda x: x
|
||||
|
||||
|
||||
class InitialValueForm(Form):
|
||||
datafield = StringField(
|
||||
label="initialvalue value",
|
||||
default="initialvalue"
|
||||
)
|
||||
datafield = StringField(label="initialvalue value", default="initialvalue")
|
||||
|
||||
errorfield = StringField(
|
||||
label="error",
|
||||
validators=[InputRequired(message="Test Error Message")]
|
||||
label="error", validators=[InputRequired(message="Test Error Message")]
|
||||
)
|
||||
|
||||
checkbox_template = env.get_template('components/checkbox_input.html')
|
||||
ci_macro = getattr(checkbox_template.module, 'CheckboxInput')
|
||||
|
||||
checkbox_template = env.get_template("components/checkbox_input.html")
|
||||
ci_macro = getattr(checkbox_template.module, "CheckboxInput")
|
||||
checkbox_input_form = InitialValueForm()
|
||||
checkbox_input_form.datafield.widget = CheckboxInput()
|
||||
rendered_checkbox_macro = ci_macro(checkbox_input_form.datafield)
|
||||
with open("js/test_templates/checkbox_input_template.html", "w") as fh:
|
||||
fh.write(rendered_checkbox_macro)
|
||||
|
||||
upload_template = env.get_template('components/upload_input.html')
|
||||
up_macro = getattr(upload_template.module, 'UploadInput')
|
||||
upload_template = env.get_template("components/upload_input.html")
|
||||
up_macro = getattr(upload_template.module, "UploadInput")
|
||||
rendered_upload_macro = up_macro(InitialValueForm().datafield)
|
||||
with open("js/test_templates/upload_input_template.html", "w") as fh:
|
||||
fh.write(rendered_upload_macro)
|
||||
|
Reference in New Issue
Block a user