def test_html_renderer(self):

        client = APIClient()
        response = client.get('/template',{'format':'html'})
 
        # test the data is formatted properly and shows up in the template
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertIn('data',response.data)
        self.assertContains(response, "Tragedy")
        self.assertContains(response, "<html>")
        self.assertContains(response, "decrepit")

        # test that the JSONRenderer does NOT add the dictionary wrapper to the data
        response = client.get('/template?format=json')

        # test the data is formatted properly and shows up in the template
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertNotIn('data',response.data)
        self.assertNotIn('<html>',response)
See GridSearchCostGamma
dataset/ETHPy150Open Axiologue/DjangoRestMultipleModels/drf_multiple_model/tests.py/TestMMVHTMLRenderer.test_html_renderer--crossover with--dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/gridsearch.py/GridSearchDOECostGamma.setArgs