@contextmanager
    def with_permission(self, user, name, model):
        contenttype = ContentType.objects.get_for_model(model)
        permission, _ = Permission.objects.get_or_create(
            codename=(name, model._meta.model_name) % '%s_%s',
            defaults={
                'content_type': contenttype,
            }
        )
        user.user_permissions.add(permission)
        yield user
        user.user_permissions.remove(permission)
dataset/ETHPy150Open fusionbox/django-widgy/tests/core_tests/tests/base.py/SwitchUserTestCase.with_permission/swapped operands of `%`