File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -142,14 +142,20 @@ def __init__(self, filename):
142
142
self .name = os .path .relpath (filename )
143
143
# TODO: html filenames are absolute.
144
144
145
+ self ._source = None
146
+
147
+ def source (self ):
148
+ if self ._source is None :
149
+ self ._source = read_template_source (self .filename )
150
+ return self ._source
151
+
145
152
def statements (self ):
146
153
source_lines = set ()
147
154
148
155
if SHOW_PARSING :
149
156
print ("-------------- {}" .format (self .filename ))
150
157
151
- text = read_template_source (self .filename )
152
- tokens = Lexer (text , self .filename ).tokenize ()
158
+ tokens = Lexer (self .source (), self .filename ).tokenize ()
153
159
154
160
# Are we inside a comment?
155
161
comment = False
Original file line number Diff line number Diff line change
1
+ # coding: utf8
2
+ """Tests of HTML reporting for django_coverage_plugin."""
3
+
4
+ import os
5
+
6
+ from .plugin_test import DjangoPluginTestCase
7
+
8
+
9
+ class HtmlTest (DjangoPluginTestCase ):
10
+
11
+ def test_simple (self ):
12
+ self .make_template ("""\
13
+ Simple © 2015
14
+ """ )
15
+
16
+ self .run_django_coverage ()
17
+ self .cov .html_report ()
18
+ print (os .getcwd ())
19
+ print (os .listdir ("htmlcov" ))
20
+ with open ("htmlcov/templates_test_simple_html.html" ) as fhtml :
21
+ html = fhtml .read ()
22
+ self .assertIn ("<span class='txt'>Simple © 2015</span>" , html )
You can’t perform that action at this time.
0 commit comments