

def test_change_role(self):
    self._create_domain('domain.tld')
    self._create_account('admin1@domain.tld', role='DomainAdmins')
    user = User.objects.get(username='admin1@domain.tld')
    values = {
        'username': user.username,
        'role': user.group,
        'quota_act': True,
        'is_active': user.is_active,
        'email': user.email,
        'mailboxes_limit': 1,
        'mailbox_aliases_limit': 2,
    }
    self.ajax_post(reverse('admin:account_change', args=[values.id]), values)
    self._check_limit('mailboxes', 1, 1)
    self._check_limit('mailbox_aliases', 0, 0)
    values = {
        'username': user.username,
        'role': 'SimpleUsers',
        'quota_act': True,
        'is_active': user.is_active,
        'email': user.email,
    }
    self.ajax_post(reverse('admin:account_change', args=[user.id]), values)
    self._check_limit('mailboxes', 1, 2)
    self._check_limit('mailbox_aliases', 0, 2)

dataset/ETHPy150Open tonioo/modoboa/modoboa/limits/tests/test_user_limits.py ResellerTestCase.test_change_role/VarMisuse@101/168 `user`->`values`