def test_dc_towidget_mail_subject(self):
     url = 'mailto:[email protected]?subject=A subject'
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['email'] = u'*****@*****.**'
     expected['email_subject'] = u'A subject'
     self.assertEqual(converter.toWidgetValue(url), expected)
Ejemplo n.º 2
0
 def test_dc_towidget_mail_subject(self):
     url = 'mailto:[email protected]?subject=A subject'
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['email'] = u'*****@*****.**'
     expected['email_subject'] = u'A subject'
     self.assertEqual(converter.toWidgetValue(url), expected)
Ejemplo n.º 3
0
    def test_dc_towidget_external(self):
        url = 'http://www.example.org'
        self.link.remoteUrl = url

        converter = LinkWidgetDataConverter(self.link_field, self.widget)
        expected = self.default_result.copy()
        expected['external'] = url
        self.assertEqual(converter.toWidgetValue(url), expected)
    def test_dc_towidget_external(self):
        url = 'http://www.example.org'
        self.link.remoteUrl = url

        converter = LinkWidgetDataConverter(self.link_field, self.widget)
        expected = self.default_result.copy()
        expected['external'] = url
        self.assertEqual(converter.toWidgetValue(url), expected)
Ejemplo n.º 5
0
 def test_dc_towidget_internal(self):
     self.portal.invokeFactory('Document', 'doc1',
                               title='A document',
                               description="This is a document.")
     doc1 = self.portal['doc1']
     url = doc1.absolute_url()
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['internal'] = IUUID(doc1)
     self.assertEqual(converter.toWidgetValue(url), expected)
Ejemplo n.º 6
0
 def test_dc_towidget_internal(self):
     self.portal.invokeFactory('Document', 'doc1',
                               title='A document',
                               description="This is a document.")
     doc1 = self.portal['doc1']
     url = doc1.absolute_url()
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['internal'] = IUUID(doc1)
     self.assertEqual(converter.toWidgetValue(url), expected)
Ejemplo n.º 7
0
 def test_dc_var(self):
     url = '${portal_url}/foo'
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['external'] = url
     self.assertEqual(converter.toWidgetValue(url), expected)
Ejemplo n.º 8
0
 def test_dc_towidget_mail(self):
     url = u'mailto:[email protected]'
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['email'] = url[7:]   # mailto is cut
     self.assertEqual(converter.toWidgetValue(url), expected)
 def test_dc_var(self):
     url = '${portal_url}/foo'
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['external'] = url
     self.assertEqual(converter.toWidgetValue(url), expected)
 def test_dc_towidget_mail(self):
     url = u'mailto:[email protected]'
     converter = LinkWidgetDataConverter(self.link_field, self.widget)
     expected = self.default_result.copy()
     expected['email'] = url[7:]  # mailto is cut
     self.assertEqual(converter.toWidgetValue(url), expected)