def test_remove_staff_member_with_orders(staff_user, permission_manage_products, order): order.user = staff_user order.save() staff_user.user_permissions.add(permission_manage_products) remove_staff_member(staff_user) staff_user = User.objects.get(pk=staff_user.pk) assert not staff_user.is_staff assert not staff_user.user_permissions.exists()
def test_remove_staff_member_with_orders(staff_user, permission_manage_products, order): order.user = staff_user order.save() staff_user.user_permissions.add(permission_manage_products) remove_staff_member(staff_user) staff_user = User.objects.get(pk=staff_user.pk) assert not staff_user.is_staff assert not staff_user.user_permissions.exists()
def test_remove_staff_member(staff_user): remove_staff_member(staff_user) assert not User.objects.filter(pk=staff_user.pk).exists()
def test_remove_staff_member(staff_user): remove_staff_member(staff_user) assert not User.objects.filter(pk=staff_user.pk).exists()