Beispiel #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)
    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)
Beispiel #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)
    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)        
Beispiel #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)
    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>'))
    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)        
Beispiel #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>'))