'Test that the get_public_endpoint and get_internal_endpoint functions
return appropriate values.'

@ddt.data(helpers.get_public_endpoint, helpers.get_internal_endpoint)
def test_get_endpoints(self, get_endpoint_function):

    @contextmanager
    def patch_edxnotes_api_settings(url):
        '\n                                                Convenience    function    for    patching    both    EDXNOTES_PUBLIC_API    and\n                                                EDXNOTES_INTERNAL_API.\n                                                '
        with override_settings(EDXNOTES_PUBLIC_API=url):
            with override_settings(EDXNOTES_INTERNAL_API=url):
                (yield)
    with patch_edxnotes_api_settings('http://example.com/'):
        self.assertEqual('http://example.com/', get_endpoint_function())
    with patch_edxnotes_api_settings('http://example.com'):
        self.assertEqual('http://example.com/', get_endpoint_function())
    with patch_edxnotes_api_settings('http://example.com'):
        self.assertEqual('http://example.com/some_path/', get_endpoint_function('/some_path'))
    with patch_edxnotes_api_settings('http://example.com'):
        self.assertEqual('http://example.com/some_path/', get_endpoint_function('some_path/'))
    with patch_edxnotes_api_settings(None):
        self.assertRaises(ImproperlyConfigured, get_endpoint_function)
