fixed regression introduced
This commit is contained in:
@@ -43,9 +43,3 @@ class Product(models.Model):
|
||||
creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='product')
|
||||
# history = models.FoiregnKey('history.History', on_delete=models.DO_NOTHING, null=True)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name} / {self.sku}"
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Producto"
|
||||
verbose_name_plural = "Productos"
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from taggit_serializer.serializers import TagListSerializerField, TaggitSerializer
|
||||
|
||||
from utils.tag_serializers import SingleTagSerializerField
|
||||
|
||||
from products.models import Product
|
||||
|
||||
from utils.tag_serializers import TagListSerializerField, TaggitSerializer, SingleTagSerializerField
|
||||
|
||||
|
||||
class ProductSerializer(TaggitSerializer, serializers.ModelSerializer):
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class ProductViewSetTest(APITestCase):
|
||||
self.model = Product
|
||||
# create user
|
||||
self.password = ''.join(random.choices(string.ascii_uppercase, k = 10))
|
||||
self.user = CustomUserFactory(password=self.password)
|
||||
self.user = CustomUserFactory(email="test@mail.com", password=self.password, is_active=True)
|
||||
|
||||
# anon user
|
||||
def test_anon_user_cannot_create_instance(self):
|
||||
|
||||
Reference in New Issue
Block a user