The following code fails when trying to assign role to user with the following error: _django.db.utils.OperationalError: (1305, 'SAVEPOINT s4590886336x1 does not exist')
This does not play well with django.test.TestCase in addition to the fact that using transactions in regular code and not only tests causes this to fail.
from django.contrib.auth.models import User
from rolepermissions.roles import AbstractUserRole
class FooRole(AbstractUserRole):
available_permissions = {
"foo": "bar"
}
user = User.objects.create(username="abc")
with transaction.atomic():
role = FooRole.assign_role_to_user(user)
The following code fails when trying to assign role to user with the following error: _django.db.utils.OperationalError: (1305, 'SAVEPOINT s4590886336x1 does not exist')
This does not play well with
django.test.TestCase
in addition to the fact that using transactions in regular code and not only tests causes this to fail.