-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import os | ||
import unittest | ||
|
||
from django.test import TestCase, tag | ||
from django.conf import settings | ||
from django.template.loader import render_to_string | ||
|
||
from html5validate import validate | ||
|
||
|
||
@tag('fast') | ||
class TemplateTests(TestCase): | ||
|
||
@unittest.skip | ||
def test_templates(self): | ||
for dir, _, filenames in os.walk(settings.TEMPLATE_DIR): | ||
for filename in filenames: | ||
filepath = os.path.join(dir, filename) | ||
filename, file_ext = os.path.splitext(filepath) | ||
if file_ext == '.html': | ||
validate(render_to_string(filepath)) | ||
|
||
def test_valid_example(self): | ||
validate(render_to_string('/usr/app/src/templates/valid_example.html')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>title</title> | ||
<link rel="stylesheet" href="style.css"> | ||
<script src="script.js"></script> | ||
</head> | ||
<body> | ||
<!-- page content --> | ||
</body> | ||
</html> |