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))
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))
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)
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)