diff --git a/django-testauth/auth.py b/django-testauth/auth.py index e42fc9f..ef3c3e3 100644 --- a/django-testauth/auth.py +++ b/django-testauth/auth.py @@ -46,6 +46,7 @@ class TESTAuthBackend: user.save() if getattr(settings, 'TEST_AUTH_CREATE_GROUPS', False): + user.groups.clear() for g in groups: group, created = Group.objects.get_or_create(name=g['name']) user.groups.add(group)