reenabled django suit

This commit is contained in:
Sam
2021-02-02 12:21:42 +00:00
parent 02b6e9545e
commit b5887c5c51
5 changed files with 25 additions and 4 deletions

View File

@@ -11,9 +11,9 @@ class CompanyFactory(DjangoModelFactory):
cif = FuzzyText(prefix='CIF_', length=10)
company_name = FuzzyText(prefix='COMPANY_NAME_', length=10)
short_name = FuzzyText(prefix='SHORT_NAME_', length=10)
web_link = FuzzyText(prefix='http://WEB_LINK_', suffix='.test', length=10)
web_link = FuzzyText(prefix='http://WEB-LINK-', suffix='.test', length=10)
shop = FuzzyChoice(choices=(True, False))
shop_link = FuzzyText(prefix='http://SHOP_LINK_', suffix='.test', length=10)
shop_link = FuzzyText(prefix='http://SHOP-LINK-', suffix='.test', length=10)
platform = FuzzyChoice(choices=[x[1] for x in Company.PLATFORMS])
email = FuzzyText(prefix='EMAIL_', suffix='@test.com', length=10)
logo = None
@@ -24,7 +24,7 @@ class CompanyFactory(DjangoModelFactory):
mobile = '+34666555333'
other_phone = '+34666555222'
description = FuzzyText(prefix='DESCRIPTION_', length=250)
shop_rss_feed = FuzzyText(prefix='http://SHOP_RSS_FEED_', suffix='.test', length=10)
shop_rss_feed = FuzzyText(prefix='http://SHOP-RSS-FEED-', suffix='.test', length=10)
sale_terms = FuzzyText(prefix='SALES_TERMS', length=250)
shipping_cost = FuzzyDecimal(low=1.00)
tags = ['cool', 'hip', 'tech/blockchain']

View File

@@ -38,8 +38,17 @@ class Company(models.Model):
shipping_cost = models.DecimalField('Gastos de envío', max_digits=10, decimal_places=2, null=True, blank=True)
tags = TagField(force_lowercase=True,max_count=5, tree=True)
sync = models.BooleanField('Sincronizar tienda', default=False, null=True, blank=True)
is_validated = models.BooleanField('Validado', default=False, null=True, blank=True)
is_active = models.BooleanField('Activado', default=False, null=True, blank=True)
# internal
created = models.DateTimeField('date of creation', auto_now_add=True)
updated = models.DateTimeField('date last update', auto_now=True)
creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='creator')
creator = models.ForeignKey('core.CustomUser', on_delete=models.DO_NOTHING, null=True, related_name='creator')
def __str__(self):
return self.company_name
class Meta:
verbose_name = "Compañía"
verbose_name_plural = "Compañías"