'Ensure that the minified versions of the JS files are only used when
DEBUG is False.
Refs #17521.'

def test_js_minified_only_if_debug_is_false(self):

    with override_settings(DEBUG=False):
        response = self.client.get((u'/test_admin/%s/admin_views/section/add/' % u'admin'))
        self.assertNotContains(response, u'jquery.js')
        self.assertContains(response, u'jquery.min.js')
        self.assertNotContains(response, u'prepopulate.js')
        self.assertContains(response, u'prepopulate.min.js')
        self.assertNotContains(response, u'actions.js')
        self.assertContains(response, u'actions.min.js')
        self.assertNotContains(response, u'collapse.js')
        self.assertContains(response, u'collapse.min.js')
        self.assertNotContains(response, u'inlines.js')
        self.assertContains(response, u'inlines.min.js')
    with override_settings(DEBUG=True):
        response = self.client.get((u'/test_admin/%s/admin_views/section/add/' % u'admin'))
        self.assertContains(response, u'jquery.js')
        self.assertNotContains(response, u'jquery.min.js')
        self.assertContains(response, u'prepopulate.js')
        self.assertNotContains(response, u'prepopulate.min.js')
        self.assertContains(response, u'actions.js')
        self.assertNotContains(response, u'actions.min.js')
        self.assertContains(response, u'collapse.js')
        self.assertNotContains(response, u'collapse.min.js')
        self.assertContains(response, u'inlines.js')
        self.assertNotContains(response, u'inlines.min.js')
