def test_external(self): with self.app.test_request_context(): l = Self(external=True) expected = {'self': {'href': 'http://localhost/'}} assert l.to_dict() == expected
def test_external(self): with self.app.test_request_context(): l = Self(external=True) expected = { 'self': { 'href': 'http://localhost/' } } assert l.to_dict() == expected
def test_to_dict(self): with self.app.test_request_context(): l = Self(foo='foo', name='foo') expected = { 'self': { 'href': '/', 'name': 'foo', } } assert l.to_dict() == expected
def test_with_server_name(self): self.app.config['SERVER_NAME'] = 'foo.com' with self.app.test_request_context(): l = Self(foo='foo', name='foo') expected = { 'self': { 'href': 'http://foo.com/', 'name': 'foo', } } assert l.to_dict() == expected