def test_xss_arguments_and_escaping(self):
        addon = Addon.objects.get()
        addon.name = 'Delicious <script src="x.js">Bookmarks'
        addon.save()
        addon = addon.reload()
        au = AddonUser(addon=addon, user=self.user)
        amo.log(amo.LOG.CHANGE_USER_WITH_ROLE, au.user, au.get_role_display(),
                addon)
        log = ActivityLog.objects.get()
        env = jingo.get_env()

        log_expected = ('yolo role changed to Owner for <a href="/en-US/'
                        'firefox/addon/a3615/">Delicious &lt;script src='
                        '&#34;x.js&#34;&gt;Bookmarks</a>.')
        assert log.to_string() == log_expected
        assert env.from_string('<p>{{ log }}</p>').render({'log': log}) == (
            log_expected % '<p>%s</p>')
dataset/ETHPy150Open mozilla/addons-server/src/olympia/devhub/tests/test_models.py/TestActivityLog.test_xss_arguments_and_escaping/swapped operands of `%`