Esempio n. 1
0
    def test_hooks(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        link = _create_elem([])
        link.value.return_value = 'link'

        elem = _create_elem([link])

        serialize_link(context, self.doc, elem, self.root)
        fire_mock.assert_called_once_with(context, self.doc, ANY, ANY, None)
Esempio n. 2
0
    def test_hooks(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        link = _create_elem([])
        link.value.return_value = 'link'

        elem = _create_elem([link])

        serialize_link(context, self.doc, elem, self.root)
        fire_mock.assert_called_once_with(context, self.doc, ANY, ANY, None)
Esempio n. 3
0
    def test_creation_empty(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        elem = _create_elem([])

        ret = serialize_link(context, self.doc, elem, self.root)
        self.assertEqual(ret, self.root)
Esempio n. 4
0
    def test_creation_empty(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        elem = _create_elem([])

        ret = serialize_link(context, self.doc, elem, self.root)
        self.assertEqual(ret, self.root)        
Esempio n. 5
0
    def test_creation_one(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        link = _create_elem([])
        link.value.return_value = 'link'

        elem = _create_elem([link])

        ret = serialize_link(context, self.doc, elem, self.root)
        self.assertEqual(ret, self.root)
Esempio n. 6
0
    def test_content(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        link = _create_elem([])
        link.value.return_value = 'link'

        elem = _create_elem([link])

        ret = serialize_link(context, self.doc, elem, self.root)
        self.assertEqual(_render(ret), six.b('<div><a href="http://www.google.com/">link</a></div>'))
Esempio n. 7
0
    def test_creation_one(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        link = _create_elem([])
        link.value.return_value = 'link'

        elem = _create_elem([link])

        ret = serialize_link(context, self.doc, elem, self.root)
        self.assertEqual(ret, self.root)        
Esempio n. 8
0
    def test_content(self, MockContext, fire_mock):
        context = _create_context(MockContext)

        link = _create_elem([])
        link.value.return_value = 'link'

        elem = _create_elem([link])

        ret = serialize_link(context, self.doc, elem, self.root)
        self.assertEqual(
            _render(ret),
            six.b('<div><a href="http://www.google.com/">link</a></div>'))