Beispiel #1
0
    def test_external(self):
        with self.app.test_request_context():
            l = Self(external=True)

            expected = {'self': {'href': 'http://localhost/'}}

            assert l.to_dict() == expected
Beispiel #2
0
    def test_external(self):
        with self.app.test_request_context():
            l = Self(external=True)

            expected = {
                'self': {
                    'href': 'http://localhost/'
                }
            }

            assert l.to_dict() == expected
Beispiel #3
0
    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
Beispiel #4
0
    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
Beispiel #5
0
    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
Beispiel #6
0
    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