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)
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')
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
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")