示例#1
0
 def test_big_install_button(self):
     doc = PyQuery(big_install_button(self.context, self.addon))
     eq_(len(doc('.install-shell')), 2)
     eq_(len(doc('.backup-button')), 1)
示例#2
0
 def test_big_install_button_backup_version(self):
     doc = PyQuery(big_install_button(self.context, self.addon))
     eq_(doc('.backup-button a.download')[0].get('href'), 'xpi.backup.url')
示例#3
0
 def test_big_install_button_xss(self, flags_mock, button_mock):
     # Make sure there's no xss in statusflags.
     button_mock.return_value = jinja2.Markup('<b>button</b>')
     flags_mock.return_value = xss = '<script src="x.js">'
     s = big_install_button(self.context, self.addon)
     assert xss not in s, s
示例#4
0
 def test_big_install_button_backup_version(self):
     doc = PyQuery(big_install_button(self.context, self.addon))
     eq_(doc('.backup-button a.download')[0].get('href'), 'xpi.backup.url')
示例#5
0
 def test_big_install_button(self):
     doc = PyQuery(big_install_button(self.context, self.addon))
     eq_(len(doc('.install-shell')), 2)
     eq_(len(doc('.backup-button')), 1)
示例#6
0
 def test_big_install_button_xss(self, flags_mock, button_mock):
     # Make sure there's no xss in statusflags.
     button_mock.return_value = jinja2.Markup('<b>button</b>')
     flags_mock.return_value = xss = '<script src="x.js">'
     s = big_install_button(self.context, self.addon)
     assert xss not in s, s
示例#7
0
 def test_big_install_button_backup_version(self):
     doc = PyQuery(big_install_button(self.context, self.addon))
     eq_(doc(".backup-button a.download")[0].get("href"), "xpi.backup.url")