-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtemplate_test.py
More file actions
executable file
·37 lines (32 loc) · 1.17 KB
/
template_test.py
File metadata and controls
executable file
·37 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
"""
Simple test to read the template directly.
"""
# Read the template file directly
template_path = "/home/lee/code/20-questions2/templates/shared/subscribe.jinja2"
with open(template_path, "r") as f:
content = f.read()
# Check for the elements that the test is looking for
checks = ['class="subscription-toggle"', 'class="money-amount"', 'class="subscription-period"', 'class="discount-chip"']
print("Checking template file directly:")
for check in checks:
found = check in content
print(f"{check}: {found}")
if found:
# Show the line where it's found
lines = content.split("\n")
for i, line in enumerate(lines):
if check in line:
print(f" Line {i + 1}: {line.strip()}")
break
print("\nChecking JavaScript functions:")
js_checks = ["setupSubscriptionToggle", '$(".subscription-toggle").change']
for check in js_checks:
found = check in content
print(f"{check}: {found}")
if found:
lines = content.split("\n")
for i, line in enumerate(lines):
if check in line:
print(f" Line {i + 1}: {line.strip()}")
break