Ejemplo n.º 1
0
 def test_desc_order(self):
     stats = list(get_series_column(Contribution, addon=self.app.pk,
                                    primary_field='revenue',
                                    category_field='currency'))
     for stat in stats:
         stat['count'] = int(stat['count'])
     eq_(stats, sorted(stats, key=lambda stat: stat['count'], reverse=True))
Ejemplo n.º 2
0
 def test_desc_order(self):
     stats = list(get_series_column(Contribution, addon=self.app.pk,
                                    primary_field='revenue',
                                    category_field='currency'))
     for stat in stats:
         stat['count'] = int(stat['count'])
     eq_(stats, sorted(stats, key=lambda stat: stat['count'], reverse=True))
Ejemplo n.º 3
0
    def test_basic_revenue(self):
        stats = list(get_series_column(Contribution, addon=self.app.pk,
                                       primary_field='revenue',
                                       category_field='currency'))

        for stat in stats:
            stat['currency'] = stat['currency'].upper()
            stat['count'] = int(stat['count'])
        stats = sorted(stats, key=lambda stat: stat['currency'])
        eq_(stats, self.expected)
Ejemplo n.º 4
0
    def test_basic_revenue(self):
        stats = list(get_series_column(Contribution, addon=self.app.pk,
                                       primary_field='revenue',
                                       category_field='currency'))

        for stat in stats:
            stat['currency'] = stat['currency'].upper()
            stat['count'] = int(stat['count'])
        stats = sorted(stats, key=lambda stat: stat['currency'])
        eq_(stats, self.expected)