def test_basic(self): workload_chart = WorkloadChart(self.env) self._insert_ticket('10', 'A') self._insert_ticket('20', 'B') self._insert_ticket('30', 'C') result = workload_chart.render_macro(self.req, "", "milestone=milestone1") self.assertEqual(result, u'<img src="http://chart.apis.google.com/chart?chs=400x100&'\ 'chd=t:10,30,20&cht=p3&chtt=Workload 60h (1 workdays left)&'\ 'chl=A 10h|C 30h|B 20h&chco=ff9900" alt=\'Workload Chart\' />')
def test_basic(self): workload_chart = WorkloadChart(self.env) self._insert_ticket('10', 'A') self._insert_ticket('20', 'B') self._insert_ticket('30', 'C') result = workload_chart.expand_macro(self.formatter, "", "milestone=milestone1") # remaining days will vary if unittest is run on workday or weekend... Ignore... result = str(result).replace('0+workdays+left', '1+workdays+left') self.assertEqual(result, '<image src="http://chart.googleapis.com/chart?' 'chd=t%3A10%2C30%2C20&chf=bg%2Cs%2C00000000&chco=ff9900&' 'chl=A+10h%7CC+30h%7CB+20h&chs=400x100&cht=p3&' 'chtt=Workload+60h+%28%7E1+workdays+left%29" alt="Workload Chart (client)"/>')
def test_basic(self): workload_chart = WorkloadChart(self.env) self._insert_ticket('10', 'A') self._insert_ticket('20', 'B') self._insert_ticket('30', 'C') result = workload_chart.expand_macro(self.formatter, "", "milestone=milestone1") # remaining days will vary if unittest is run on workday or weekend... Ignore... result = str(result).replace('0+workdays+left', '1+workdays+left') self.assertEqual( result, '<image src="http://chart.apis.google.com/chart?' 'chd=t%3A10%2C30%2C20&chf=bg%2Cs%2C00000000&chco=ff9900&' 'chl=A+10h%7CC+30h%7CB+20h&chs=400x100&cht=p3&' 'chtt=Workload+60h+%28%7E1+workdays+left%29" alt="Workload Chart (client)"/>' )
def test_username_obfuscation(self): workload_chart = WorkloadChart(self.env) self._insert_ticket('10', '*****@*****.**') result = workload_chart.expand_macro(self.formatter, "", "milestone=milestone1") self.failUnless("&chl=user%40%E2%80%A6+10h&" in str(result))