Esempio n. 1
0
    def test_CORS(self):
        """any use of model_wrapper should return a CORS header"""
        def mocked_get(**options):
            return {
                "breakpad_revision": "1139",
                "socorro_revision": "9cfa4de",
            }

        Status.implementation().get.side_effect = mocked_get

        url = reverse('api:model_wrapper', args=('Status', ))
        response = self.client.get(url)
        assert response.status_code == 200
        assert response['Access-Control-Allow-Origin'] == '*'
Esempio n. 2
0
    def test_CORS(self):
        """any use of model_wrapper should return a CORS header"""

        def mocked_get(**options):
            return {
                "breakpad_revision": "1139",
                "socorro_revision": "9cfa4de",
            }

        Status.implementation().get.side_effect = mocked_get

        url = reverse('api:model_wrapper', args=('Status',))
        response = self.client.get(url)
        eq_(response.status_code, 200)
        eq_(response['Access-Control-Allow-Origin'], '*')
Esempio n. 3
0
    def test_Status(self):
        def mocked_get(**options):
            return {
                "breakpad_revision": "1139",
                "socorro_revision": "9cfa4de",
            }

        Status.implementation().get.side_effect = mocked_get

        url = reverse('api:model_wrapper', args=('Status', ))
        response = self.client.get(url)
        assert response.status_code == 200
        dump = json.loads(response.content)
        assert dump['socorro_revision']
        assert dump['breakpad_revision']
Esempio n. 4
0
    def test_Status(self):

        def mocked_get(**options):
            return {
                "breakpad_revision": "1139",
                "socorro_revision": "9cfa4de",
            }

        Status.implementation().get.side_effect = mocked_get

        url = reverse('api:model_wrapper', args=('Status',))
        response = self.client.get(url)
        eq_(response.status_code, 200)
        dump = json.loads(response.content)
        ok_(dump['socorro_revision'])
        ok_(dump['breakpad_revision'])