...
1 package django_test
2
3 import (
4 "testing"
5
6 "github.com/noirbizarre/gonja"
7 "github.com/noirbizarre/gonja/ext/django"
8 tu "github.com/noirbizarre/gonja/testutils"
9 )
10
11 func Env(root string) *gonja.Environment {
12 env := tu.TestEnv(root)
13 env.Filters.Update(django.Filters)
14 env.Statements.Update(django.Statements)
15 return env
16 }
17
18 func TestDjangoTemplates(t *testing.T) {
19 root := "./testData"
20 env := Env(root)
21 tu.GlobTemplateTests(t, root, env)
22 }
23
24 func TestDjangoFilters(t *testing.T) {
25 root := "./testData/filters"
26 env := Env(root)
27 tu.GlobTemplateTests(t, root, env)
28 }
29
30 func TestDjangoStatements(t *testing.T) {
31 root := "./testData/statements"
32 env := Env(root)
33 tu.GlobTemplateTests(t, root, env)
34 }
35
View as plain text