Commits

Mads Sülau Valstorp Jørgensen committed c3f9b84

Fixed whitespace replacing tabs, added regression test

Comments (0)

Files changed (2)

chart_tools/templatetags/chart_tags.py

 
 def prepare_chart(input, attr=''):
     # remove whitespaces
-    input_lines = input.replace(' ', '').splitlines()
+    input_lines = input.replace(' ', '').replace('\t', '').splitlines()
 
     # build url
     lines = []

chart_tools/tests.py

 
     def test_cleaned_chart(self):
         self.assertChartRendered('cleaned_up')
+
+class RegressionTest(TestCase):
+
+    def test_tab_as_whitespace(self):
+        chart_input = FIXTURES['cleaned_up'].replace(" ", "\t")
+        self.assertFalse(chart_input.find("\t") == -1)
+        chart_img = prepare_chart(chart_input)
+        self.assertTrue(chart_img.find("\t") == -1)
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.