def test_url_encode(self):
     start = datetime.now(utc).date()
     end = (start + timedelta(days=5)).strftime('%Y-%m-%d')
     start = start.strftime('%Y-%m-%d')
     chart = BurndownChart(self.env)
     t = Ticket(self.env, self._insert_ticket('12'))
     result = chart.expand_macro(self.formatter, 'BurndownChart',
                     "milestone=milestone1, startdate=%s, enddate=%s" % (start, end))
     self.failUnless("&chtt=milestone1&" in str(result))
     result = chart.expand_macro(self.formatter, 'BurndownChart',
                     "milestone=One & Two, startdate=%s, enddate=%s" % (start, end))
     self.failUnless("&chtt=One+%26+Two&" in str(result))
Example #2
0
 def test_url_encode(self):
     start = datetime.now(utc).date()
     end = (start + timedelta(days=5)).strftime('%Y-%m-%d')
     start = start.strftime('%Y-%m-%d')
     chart = BurndownChart(self.env)
     t = Ticket(self.env, self._insert_ticket('12'))
     result = chart.expand_macro(
         self.formatter, 'BurndownChart',
         "milestone=milestone1, startdate=%s, enddate=%s" % (start, end))
     self.failUnless("&chtt=milestone1&" in str(result))
     result = chart.expand_macro(
         self.formatter, 'BurndownChart',
         "milestone=One & Two, startdate=%s, enddate=%s" % (start, end))
     self.failUnless("&chtt=One+%26+Two&" in str(result))
 def test_expected_y_axis(self):
     start = datetime.now(utc).date()
     end = (start + timedelta(days=5)).strftime('%Y-%m-%d')
     start = start.strftime('%Y-%m-%d')
     chart = BurndownChart(self.env)
     t = Ticket(self.env, self._insert_ticket('12'))
     # Test without expected
     result = chart.expand_macro(self.formatter, 'BurndownChart',
                     "startdate=%s, enddate=%s" % (start, end))
     self.assertEquals(self._extract_query(result)['chxr'], [u'2,0,12'])
     # Confirm Y axis changes with new higher expected
     result = chart.expand_macro(self.formatter, 'BurndownChart',
                     "startdate=%s, enddate=%s, expected=200" % (start, end))
     self.assertEquals(self._extract_query(result)['chxr'], [u'2,0,200'])
Example #4
0
 def test_expected_y_axis(self):
     start = datetime.now(utc).date()
     end = (start + timedelta(days=5)).strftime('%Y-%m-%d')
     start = start.strftime('%Y-%m-%d')
     chart = BurndownChart(self.env)
     t = Ticket(self.env, self._insert_ticket('12'))
     # Test without expected
     result = chart.expand_macro(self.formatter, 'BurndownChart',
                                 "startdate=%s, enddate=%s" % (start, end))
     self.assertEquals(self._extract_query(result)['chxr'], [u'2,0,12'])
     # Confirm Y axis changes with new higher expected
     result = chart.expand_macro(
         self.formatter, 'BurndownChart',
         "startdate=%s, enddate=%s, expected=200" % (start, end))
     self.assertEquals(self._extract_query(result)['chxr'], [u'2,0,200'])
Example #5
0
 def test_build_zero_day_chart(self):
     chart = BurndownChart(self.env)
     # shouldn't throw
     chart.expand_macro(self.formatter, "",
                        "startdate=2008-01-01, enddate=2008-01-01")
 def test_build_zero_day_chart(self):
     chart = BurndownChart(self.env)
     # shouldn't throw
     chart.expand_macro(self.formatter, "",
                        "startdate=2008-01-01, enddate=2008-01-01")