def test_ajax_day_view(self):
        response = self.client.get(
            reverse(
                'calendar:day_list',
                kwargs={'year': '2015', 'month': '2', 'day': '2'}
            ),
            HTTP_X_REQUESTED_WITH='XMLHttpRequest'
        )
        self.assertEqual(response['Content-Type'], 'application/json')

        data = loads(response.content.decode('utf8'))
        self.assertEqual([], data['events'])
Test sending an ajax request to day view.
dataset/ETHPy150Open wreckage/django-happenings/tests/unit_tests/test_ajax.py/AjaxTest.test_ajax_day_view