Example #1
0
    def test_get_allowed_filters(self):
        r = ReportConfiguration(
            filtering='user.first_name'
        )
        g = r.get_allowed_filters()
        self.assertEqual(['user.first_name'], g)

        r = ReportConfiguration(
            filtering='user=first_name'
        )
        g = r.get_allowed_filters()
        self.assertEqual([], g)

        r = ReportConfiguration(
            filtering='''user.first_name
            user.last_name
            user=email
            '''
        )
        g = r.get_allowed_filters()
        self.assertEqual(['user.first_name', 'user.last_name'], g)