import mock
from requests.models import Response

from django.test import TestCase


class TestSomething(TestCase):
    def test_something_in_something(self):
        response = Response()
        response.status_code = 200
        # set the json response to what we're expecting
        response.json = mock.MagicMock(return_value={'test': 'Test'})
        mocked_get = mock.MagicMock(return_value=response)
        with mock.patch('requests.get', mocked_get):
            # test whatever you need to here