@override_settings(DEBUG=False)
    def test_api_accepts_decorator(self):
        original_log_level = logger.level
        logger.setLevel(1000)

        # Test that POSTs are validated.
        @api_accepts({
            'im_required': forms.IntegerField(),
        })
        def my_failed_post_view(request, *args, **kwargs):
            return JsonResponseWithStatus('still called on failure')

        rf = RequestFactory()
        request = rf.post('/post_failure', data={'hello': 'world'})
        response = my_failed_post_view(request)
        self.assertEquals(response.status_code, 200)
        response_json = json.loads(response.content)
        self.assertEquals(response_json['error_message'], 'still called on failure')
        logger.setLevel(original_log_level)
Initialize the backend.
dataset/ETHPy150Open bipsandbytes/django-api/django_api/tests.py/SimpleTest.test_api_accepts_decorator--crossover with--dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/provision/backend.py/ProvisionBackend.init