Beispiel #1
0
 def test_funnel(self):
     widget = funnel(lambda r: self.funnel_data)
     resp = widget(self.request)
     self.assertEqual(
         '{"item": [{"value": 50, "label": "step 2"}, '
         '{"value": 100, "label": "step 1"}], "type": "reverse", "percentage": "hide"}',
         resp.content)
Beispiel #2
0
 def test_funnel_sorting(self):
     sortable_data = self.funnel_data
     sortable_data.update({'sort': True})
     widget = funnel(lambda r: sortable_data)
     resp = widget(self.request)
     self.assertEqual(
         '{"item": [{"value": 100, "label": "step 1"}, '
         '{"value": 50, "label": "step 2"}], "type": "reverse", "percentage": "hide"}',
         resp.content)
 def test_funnel_sorting(self):
     sortable_data = self.funnel_data
     sortable_data.update({
         'sort': True
     })
     widget = funnel(lambda r: sortable_data)
     resp = widget(self.request)
     self.assertEqual('{"item": [{"value": 100, "label": "step 1"}, '
                 '{"value": 50, "label": "step 2"}], "type": "reverse", '
                 '"percentage": "hide"}', resp.content)
Beispiel #4
0
 def test_funnel(self):
     widget = funnel(lambda r: self.funnel_data)
     resp = widget(self.request)
     json = simplejson.loads(resp.content)
     data = {
         'type': 'reverse',
         'percentage': 'hide',
         'item': [
             {'value': 50, 'label': 'step 2'},
             {'value': 100, 'label': 'step 1'},
         ],
     }
     self.assertEqual(json, data)
 def test_funnel(self):
     widget = funnel(lambda r: self.funnel_data)
     resp = widget(self.request)
     content = json.loads(resp.content.decode('utf8'))
     expected = {
         'type': 'reverse',
         'percentage': 'hide',
         'item': [
             {'value': 50, 'label': 'step 2'},
             {'value': 100, 'label': 'step 1'},
         ],
     }
     self.assertEqual(content, expected)
Beispiel #6
0
 def test_funnel(self):
     widget = funnel(lambda r: self.funnel_data)
     resp = widget(self.request)
     json = simplejson.loads(resp.content)
     data = {
         'type': 'reverse',
         'percentage': 'hide',
         'item': [
             {'value': 50, 'label': 'step 2'},
             {'value': 100, 'label': 'step 1'},
         ],
     }
     self.assertEqual(json, data)
Beispiel #7
0
 def test_funnel_sorting(self):
     sortable_data = self.funnel_data
     sortable_data.update({
         'sort': True
     })
     widget = funnel(lambda r: sortable_data)
     resp = widget(self.request)
     content = json.loads(resp.content)
     expected = {
         'type': 'reverse',
         'percentage': 'hide',
         'item': [
             {'value': 100, 'label': 'step 1'},
             {'value': 50, 'label': 'step 2'},
         ],
     }
     self.assertEqual(content, expected)
Beispiel #8
0
 def test_funnel_sorting(self):
     sortable_data = self.funnel_data
     sortable_data.update({'sort': True})
     widget = funnel(lambda r: sortable_data)
     resp = widget(self.request)
     content = json.loads(resp.content)
     expected = {
         'type':
         'reverse',
         'percentage':
         'hide',
         'item': [
             {
                 'value': 100,
                 'label': 'step 1'
             },
             {
                 'value': 50,
                 'label': 'step 2'
             },
         ],
     }
     self.assertEqual(content, expected)
 def test_funnel(self):
     widget = funnel(lambda r: self.funnel_data)
     resp = widget(self.request)
     self.assertEqual('{"item": [{"value": 50, "label": "step 2"}, '
             '{"value": 100, "label": "step 1"}], "type": "reverse", '
             '"percentage": "hide"}', resp.content)