def create_staff_user(self): user = UserFactory(username=self.username, email=self.email, password=self.password) user.is_staff = True user.save() return user
def create_staff_user(self): user = UserFactory(username=self.username, email=self.email, password=self.password) user.is_staff = True user.save() if self.model: content_type = ContentType.objects.get_for_model(self.model) for perm in self.permissions: user.user_permissions.add(Permission.objects.get(content_type=content_type, codename=perm)) return user
def create_staff_user(self): user = UserFactory(username=self.username, email=self.email, password=self.password) user.is_staff = True user.save() if self.model: content_type = ContentType.objects.get_for_model(self.model) for perm in self.permissions: user.user_permissions.add( Permission.objects.get(content_type=content_type, codename=perm)) return user