Пример #1
0
    def test_placeholder_property_can_be_overriden_on_any_context(self, browser):
        del self.portal.search_label
        self.portal._setProperty('search_label', 'search portal', 'string')
        folder = create(Builder('folder'))
        folder._setProperty('search_label', 'search folder', 'string')
        transaction.commit()

        placeholders = {}

        browser.login().open()
        placeholders['portal'] = search_field_placeholder()
        browser.open(folder)
        placeholders['folder'] = search_field_placeholder()

        self.assertEqual({'portal': 'search portal', 'folder': 'search folder'}, placeholders)
Пример #2
0
 def test_customize_placeholder_by_setting_property_with_umlauts(self, browser):
     self.portal._setProperty('search_label', 'R\xc3\xa4ume durchsuchen',
                              'string')
     transaction.commit()
     browser.login().open()
     self.assertEquals(u'R\xe4ume durchsuchen',
                       search_field_placeholder())
Пример #3
0
 def test_default_plone_placeholder_is_used_by_default(self, browser):
     browser.login().open()
     default_placeholder = translate('title_search_site',
                                     domain='plone',
                                     context=self.request)
     self.assertEquals(default_placeholder,
                       search_field_placeholder())
Пример #4
0
 def test_customize_placeholder_by_setting_property(self, browser):
     self.portal._setProperty('search_label', 'Search example.com',
                              'string')
     transaction.commit()
     browser.login().open()
     self.assertEquals('Search example.com',
                       search_field_placeholder())
 def test_customize_placeholder_by_setting_property(self, browser):
     del self.portal.search_label
     self.portal._setProperty('search_label', 'Search example.com',
                              'string')
     transaction.commit()
     browser.login().open()
     self.assertEqual('Search example.com', search_field_placeholder())
Пример #6
0
 def test_customize_placeholder_by_setting_property_with_umlauts(
         self, browser):
     self.portal._setProperty('search_label', 'R\xc3\xa4ume durchsuchen',
                              'string')
     transaction.commit()
     browser.login().open()
     self.assertEquals(u'R\xe4ume durchsuchen', search_field_placeholder())
    def test_placeholder_property_can_be_overriden_on_any_context(
            self, browser):
        del self.portal.search_label
        self.portal._setProperty('search_label', 'search portal', 'string')
        folder = create(Builder('folder'))
        folder._setProperty('search_label', 'search folder', 'string')
        transaction.commit()

        placeholders = {}

        browser.login().open()
        placeholders['portal'] = search_field_placeholder()
        browser.open(folder)
        placeholders['folder'] = search_field_placeholder()

        self.assertEqual({
            'portal': 'search portal',
            'folder': 'search folder'
        }, placeholders)
Пример #8
0
 def test_placeholder_property_is_inherited(self, browser):
     del self.portal.search_label
     self.portal._setProperty('search_label', 'search site', 'string')
     folder = create(Builder('folder'))
     browser.login().open(folder)
     self.assertEqual('search site', search_field_placeholder())
Пример #9
0
 def test_empty_placeholder_by_setting_property(self, browser):
     del self.portal.search_label
     self.portal._setProperty('search_label', '', 'string')
     transaction.commit()
     browser.login().open()
     self.assertEquals('', search_field_placeholder())
Пример #10
0
 def test_default_plone_placeholder_is_used_by_default(self, browser):
     browser.login().open()
     self.assertEqual('Search OneGov Gever', search_field_placeholder())
Пример #11
0
 def test_placeholder_property_is_inherited(self, browser):
     del self.portal.search_label
     self.portal._setProperty('search_label', 'search site', 'string')
     folder = create(Builder('folder'))
     browser.login().open(folder)
     self.assertEqual('search site', search_field_placeholder())
Пример #12
0
 def test_empty_placeholder_by_setting_property(self, browser):
     del self.portal.search_label
     self.portal._setProperty('search_label', '', 'string')
     transaction.commit()
     browser.login().open()
     self.assertEquals('', search_field_placeholder())
Пример #13
0
 def test_default_plone_placeholder_is_used_by_default(self, browser):
     browser.login().open()
     self.assertEqual('Search OneGov Gever', search_field_placeholder())
Пример #14
0
 def test_default_plone_placeholder_is_used_by_default(self, browser):
     browser.login().open()
     default_placeholder = translate('title_search_site',
                                     domain='plone',
                                     context=self.request)
     self.assertEquals(default_placeholder, search_field_placeholder())