def test_flat_custom_labels(self):

        view = FlatLabelView.as_view()

        request = factory.get('/')
        with self.assertNumQueries(2):
            response = view(request).render()

        self.assertEqual(response.status_code, status.HTTP_200_OK)

        self.assertEqual(len(response.data),6)
        self.assertEqual(response.data,[
            OrderedDict([('genre','Tragedy'),('title','Romeo And Juliet'),('year',1597),('type', 'Drama')]),
            OrderedDict([('genre','Comedy'),('title',"A Midsummer Night's Dream"),('year',1600),('type', 'Drama')]),
            OrderedDict([('genre','Tragedy'),('title','Julius Caesar'),('year',1623),('type', 'Drama')]),
            OrderedDict([('genre','Comedy'),('title','As You Like It'),('year',1623),('type', 'Drama')]),
            OrderedDict([('title',"Shall I compare thee to a summer's day?"),('style','Sonnet'),('type', 'Poetry')]),
            OrderedDict([('title',"As a decrepit father takes delight"),('style','Sonnet'),('type', 'Poetry')]),
        ])
Putting flat=True should flatten the data to a single list of elements
dataset/ETHPy150Open Axiologue/DjangoRestMultipleModels/drf_multiple_model/tests.py/TestMMViews.test_flat_custom_labels