def METHOD_NAME(self):
    CountryAccessRuleFactory(restricted_course=RestrictedCourseFactory(course_key=self.course_id))
    self.user.is_staff = False
    self.user.save()
    # Appear to make a request from an IP in the blocked country
    # pylint: disable=unused-argument
    def mock_country(reader, country):
        """
        :param reader:
        :param country:
        :return:
        """
        magic_mock = MagicMock()
        magic_mock.country = MagicMock()
        type(magic_mock.country).iso_code = 'US'
        return magic_mock
    patcher = patch.object(maxminddb, 'open_database')
    patcher.start()
    country_patcher = patch.object(geoip2.database.Reader, 'country', mock_country)
    country_patcher.start()
    self.addCleanup(patcher.stop)
    self.addCleanup(country_patcher.stop)
    response = self.client.get(self.url, data=self.request_data)
    expected_response = {'access': False}
    assert response.status_code == 200
    assert response.data == expected_response