# Path: products/models.py
# class ProductCategory(models.Model):
#     """docstring for Category."""
# 
#     category_name = models.CharField(
#         help_text=_("Nome da categoria de produtos"),
#         verbose_name=_("Categoria de Produto"),
#         max_length=100, null=False, blank=False
#     )
#     father_category = models.ForeignKey(
#         'self',
#         null=True,
#         blank=True
#         )
# 
#     class Meta:
#         verbose_name = _('Categoria de Produtos')
#         verbose_name_plural = ('Categorias de produtos')
# 
#     def __str__(self):
#         return self.category_name
# 
# Path: cart/models.py
# class Cart(models.Model):
#     creation_date = models.DateTimeField(default=datetime.now,
#                                          verbose_name=_('creation date'))
#     checked_out = models.BooleanField(default=False,
#                                       verbose_name=_('checked out'))
# 
#     class Meta:
#         verbose_name = _('cart')
#         verbose_name_plural = _('carts')
#         ordering = ('-creation_date',)
# 
#     def __str__(self):
#         return str(self.creation_date)
# 
# Path: users/models.py
# class CustomerUser(User):
#     """docstring for CustomerUser"""
#     cellphone = models.CharField(
#         help_text=_("Número de telefone. Preencha apenas com númreos."),
#         verbose_name=_("Telefone Celular"),
#         max_length=15, null=False, blank=False)
# 
#     phone_number = models.CharField(
#         help_text=_("Número de telefone. Preencha apenas com númreos."),
#         verbose_name=_("Teledone Fixo"),
#         max_length=15, null=True, blank=False)
# 
#     class Meta:
#         verbose_name = _('Cliente')
#         verbose_name_plural = _('Clientes')
# 
#     def __str__(self):
#         return (self.first_name + " " + self.last_name)
# 
# class CreditCard(models.Model):
#     """docstring for CreditCard"""
#     user = models.ForeignKey(CustomerUser)
#     owner_name = models.CharField(
#         help_text=_("Preencha como está no " + credit_card_verbose_name),
#         verbose_name=_("Nome do Titular do " + credit_card_verbose_name),
#         max_length=256)
#     card_number = models.CharField(
#         verbose_name=_("Número do " + credit_card_verbose_name),
#         max_length=16)
#     security_code = models.CharField(
#         verbose_name=_("Código de Segurança do " + credit_card_verbose_name),
#         max_length=3)
#     expire_date = models.DateField(
#         verbose_name=_("Validade do " + credit_card_verbose_name))
#     provider = models.CharField(
#         verbose_name=_("Bandeira do " + credit_card_verbose_name),
#         max_length=20)
# 
#     class Meta:
#         verbose_name = _(credit_card_verbose_name)
#         verbose_name_plural = _(credit_card_verbose_name_plural)
# 
#     def __str__(self):
#         return ("************" + self.card_number[-4:])


import pytest
from products.models import ProductCategory
from cart.models import (
    Cart,
    # ItemManager,
    # Item
    )
from users.models import (CustomerUser, CreditCard)
#     cart.save()
#     cart.delete()

#     item = ItemManager()

#     item.cart = cart
#     item.quantity = 12
#     item.unit_price = 12.9
#     item.content_type = item.Product()
#     item.object_id = 12
#     item.objects = item.ItemManager()

#     item.save()
#     count_items = Item.objects.all().count()

#     assert count_items >= 1
#     item.delete()


@pytest.mark.django_db
def test_credit_card():
    user = CustomerUser()
    user.name = 'Gabriela'
    user.last_name = 'Gama'
    user.set_password('123456')
    user.email = 'gaby@mail.com'
    user.phone_number = '98765432'
    user.cellphone = '123454657'
    user.save()


# Path: products/models.py
# class ProductCategory(models.Model):
#     """docstring for Category."""
# 
#     category_name = models.CharField(
#         help_text=_("Nome da categoria de produtos"),
#         verbose_name=_("Categoria de Produto"),
#         max_length=100, null=False, blank=False
#     )
#     father_category = models.ForeignKey(
#         'self',
#         null=True,
#         blank=True
#         )
# 
#     class Meta:
#         verbose_name = _('Categoria de Produtos')
#         verbose_name_plural = ('Categorias de produtos')
# 
#     def __str__(self):
#         return self.category_name
# 
# Path: cart/models.py
# class Cart(models.Model):
#     creation_date = models.DateTimeField(default=datetime.now,
#                                          verbose_name=_('creation date'))
#     checked_out = models.BooleanField(default=False,
#                                       verbose_name=_('checked out'))
# 
#     class Meta:
#         verbose_name = _('cart')
#         verbose_name_plural = _('carts')
#         ordering = ('-creation_date',)
# 
#     def __str__(self):
#         return str(self.creation_date)
# 
# Path: users/models.py
# class CustomerUser(User):
#     """docstring for CustomerUser"""
#     cellphone = models.CharField(
#         help_text=_("Número de telefone. Preencha apenas com númreos."),
#         verbose_name=_("Telefone Celular"),
#         max_length=15, null=False, blank=False)
# 
#     phone_number = models.CharField(
#         help_text=_("Número de telefone. Preencha apenas com númreos."),
#         verbose_name=_("Teledone Fixo"),
#         max_length=15, null=True, blank=False)
# 
#     class Meta:
#         verbose_name = _('Cliente')
#         verbose_name_plural = _('Clientes')
# 
#     def __str__(self):
#         return (self.first_name + " " + self.last_name)
# 
# class CreditCard(models.Model):
#     """docstring for CreditCard"""
#     user = models.ForeignKey(CustomerUser)
#     owner_name = models.CharField(
#         help_text=_("Preencha como está no " + credit_card_verbose_name),
#         verbose_name=_("Nome do Titular do " + credit_card_verbose_name),
#         max_length=256)
#     card_number = models.CharField(
#         verbose_name=_("Número do " + credit_card_verbose_name),
#         max_length=16)
#     security_code = models.CharField(
#         verbose_name=_("Código de Segurança do " + credit_card_verbose_name),
#         max_length=3)
#     expire_date = models.DateField(
#         verbose_name=_("Validade do " + credit_card_verbose_name))
#     provider = models.CharField(
#         verbose_name=_("Bandeira do " + credit_card_verbose_name),
#         max_length=20)
# 
#     class Meta:
#         verbose_name = _(credit_card_verbose_name)
#         verbose_name_plural = _(credit_card_verbose_name_plural)
# 
#     def __str__(self):
#         return ("************" + self.card_number[-4:])


# Path: tests/test_models.py
import pytest
from products.models import ProductCategory
from cart.models import (
    Cart,
    # ItemManager,
    # Item
    )
from users.models import (CustomerUser, CreditCard)

#     cart.save()
#     cart.delete()

#     item = ItemManager()

#     item.cart = cart
#     item.quantity = 12
#     item.unit_price = 12.9
#     item.content_type = item.Product()
#     item.object_id = 12
#     item.objects = item.ItemManager()

#     item.save()
#     count_items = Item.objects.all().count()

#     assert count_items >= 1
#     item.delete()


@pytest.mark.django_db
def test_credit_card():
    user = CustomerUser()
    user.name = 'Gabriela'
    user.last_name = 'Gama'
    user.set_password('123456')
    user.email = 'gaby@mail.com'
    user.phone_number = '98765432'
    user.cellphone = '123454657'
    user.save()


    credit_card = CreditCard()