Fakultas Ilmu Komputer UI

Commit 86958fad authored by azrdfa's avatar azrdfa
Browse files

Merge branch 'dev' into staging

parents f3317b14 b3525d12
Pipeline #82073 failed with stages
in 1 minute and 52 seconds
......@@ -4,4 +4,8 @@ __pycache__/
.env_var
static
env
.env
\ No newline at end of file
.env
.scannerwork
.vscode
coverage.xml
media
# Generated by Django 3.0.7 on 2020-10-22 09:08
# Generated by Django 3.0.7 on 2021-06-06 13:02
import api.utils
import re
import uuid
from decimal import Decimal
from django.conf import settings
from django.contrib.postgres import operations as postgres_operations
import api.utils
import django.contrib.auth.models
import django.contrib.auth.validators
import django.contrib.postgres.fields.citext
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import phonenumber_field.modelfields
import re
import uuid
from django.conf import settings
from django.contrib.postgres import operations as postgres_operations
from django.db import migrations, models
class Migration(migrations.Migration):
......@@ -75,6 +76,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID')),
('bank_name', models.CharField(max_length=100, verbose_name='bank name')),
('bank_code_number', models.CharField(default='000', max_length=100, verbose_name='bank code number')),
('bank_account_number', models.CharField(max_length=100, verbose_name='bank account number')),
('bank_account_name', models.CharField(max_length=200, verbose_name='bank account name')),
],
......@@ -133,8 +135,15 @@ class Migration(migrations.Migration):
('description', models.TextField(verbose_name='description')),
('price', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='price')),
('stock', models.PositiveIntegerField(blank=True, null=True, verbose_name='stock')),
('pre_order', models.BooleanField(default=False, verbose_name='pre-order')),
('modal', models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='modal')),
('profit', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='profit')),
('image', models.ImageField(blank=True, null=True, upload_to=api.utils.get_upload_file_path, verbose_name='image')),
('total_profit', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0'), max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='total profit')),
('is_hampers', models.BooleanField(default=False, verbose_name='the product is hampers package')),
('hampers_price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))], verbose_name='hampers price')),
('unit', models.CharField(default='buah', max_length=200, verbose_name='unit')),
('preorder', models.BooleanField(blank=True, default=False, null=True, verbose_name='preorder')),
('preorder_duration', models.PositiveIntegerField(blank=True, default=0, null=True, verbose_name='preorder duration')),
],
options={
'verbose_name': 'product',
......@@ -202,6 +211,7 @@ class Migration(migrations.Migration):
('transfer_destination_bank_name', models.CharField(blank=True, max_length=100, null=True, verbose_name='transfer destination bank name')),
('transfer_destination_bank_account_name', models.CharField(blank=True, max_length=200, null=True, verbose_name='transfer destination bank account name')),
('transfer_destination_bank_account_number', models.CharField(blank=True, max_length=100, null=True, verbose_name='transfer destination bank account number')),
('transfer_destination_bank_code_number', models.CharField(blank=True, max_length=100, null=True, verbose_name='transfer destination bank code number')),
('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
('updated_at', models.DateTimeField(auto_now=True, db_index=True, verbose_name='updated at')),
('batch_name', models.CharField(max_length=200, verbose_name='batch name')),
......@@ -222,10 +232,12 @@ class Migration(migrations.Migration):
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID')),
('product_name', models.CharField(max_length=200, verbose_name='product name')),
('product_price', models.DecimalField(decimal_places=2, max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='product price')),
('product_pre_order', models.BooleanField(verbose_name='product pre-order')),
('hampers_price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.00'))], verbose_name='hampers price')),
('hampers_messages', models.CharField(default='', max_length=100, verbose_name='hampers messages')),
('quantity', models.PositiveIntegerField(verbose_name='quantity')),
('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transaction_items', to='api.Product', verbose_name='product')),
('transaction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transaction_items', to='api.Transaction', verbose_name='transaction')),
('profit', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0'), max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='total profit')),
],
options={
'verbose_name': 'transaction item',
......@@ -259,6 +271,21 @@ class Migration(migrations.Migration):
'ordering': ['user', 'id'],
},
),
migrations.CreateModel(
name='ProgramProgress',
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField(verbose_name='date')),
('description', django.contrib.postgres.fields.citext.CICharField(max_length=200, verbose_name='description')),
('image', models.ImageField(blank=True, null=True, upload_to=api.utils.get_upload_file_path, verbose_name='image')),
('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='program', to='api.Program', verbose_name='program')),
],
options={
'verbose_name': 'program progress',
'verbose_name_plural': 'program progress',
'ordering': ['-date', 'id'],
},
),
migrations.CreateModel(
name='ProgramDonation',
fields=[
......@@ -276,6 +303,7 @@ class Migration(migrations.Migration):
('transfer_destination_bank_name', models.CharField(blank=True, max_length=100, null=True, verbose_name='transfer destination bank name')),
('transfer_destination_bank_account_name', models.CharField(blank=True, max_length=200, null=True, verbose_name='transfer destination bank account name')),
('transfer_destination_bank_account_number', models.CharField(blank=True, max_length=100, null=True, verbose_name='transfer destination bank account number')),
('transfer_destination_bank_code_number', models.CharField(blank=True, max_length=100, null=True, verbose_name='transfer destination bank code number')),
('goods_quantity', models.DecimalField(blank=True, decimal_places=0, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('1'))], verbose_name='goods quantity')),
('goods_description', models.CharField(blank=True, max_length=200, null=True, verbose_name='goods description')),
('delivery_method', models.CharField(blank=True, choices=[('PCK', 'Pick Up'), ('DLV', 'Delivered')], max_length=3, null=True, verbose_name='goods delivery method')),
......@@ -302,6 +330,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.PositiveIntegerField(default=0, verbose_name='quantity')),
('hampers_messages', models.CharField(default='', max_length=100, verbose_name='hampers messages')),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cart_items', to='api.Product', verbose_name='product')),
('shopping_cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cart_items', to='api.ShoppingCart', verbose_name='shopping cart')),
],
......
# Generated by Django 3.0.7 on 2020-12-29 03:28
import api.utils
from decimal import Decimal
import django.contrib.postgres.fields.citext
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='pre_order',
),
migrations.RemoveField(
model_name='transactionitem',
name='product_pre_order',
),
migrations.AddField(
model_name='product',
name='modal',
field=models.DecimalField(decimal_places=2, default=Decimal('0'), max_digits=12, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='modal'),
),
migrations.AddField(
model_name='product',
name='profit',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='profit'),
),
migrations.AddField(
model_name='product',
name='total_profit',
field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0'), max_digits=12, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='total profit'),
),
migrations.CreateModel(
name='ProgramProgress',
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField(verbose_name='date')),
('description', django.contrib.postgres.fields.citext.CICharField(max_length=200, verbose_name='description')),
('image', models.ImageField(blank=True, null=True, upload_to=api.utils.get_upload_file_path, verbose_name='image')),
('program', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='program', to='api.Program', verbose_name='program')),
],
options={
'verbose_name': 'program progress',
'verbose_name_plural': 'program progress',
'ordering': ['-date', 'id'],
},
),
]
......@@ -53,6 +53,7 @@ class User(auth_models.AbstractUser):
class BankAccountTransferDestination(db_models.Model):
id = db_models.UUIDField(default=uuid.uuid4, primary_key=True, verbose_name=_('ID'))
bank_name = db_models.CharField(max_length=100, verbose_name=_('bank name'))
bank_code_number = db_models.CharField(max_length=100, verbose_name=_('bank code number'), default='000')
bank_account_number = db_models.CharField(max_length=100, verbose_name=_('bank account number'))
bank_account_name = db_models.CharField(max_length=200, verbose_name=_('bank account name'))
......@@ -63,7 +64,7 @@ class BankAccountTransferDestination(db_models.Model):
verbose_name_plural = _('bank account transfer destinations')
def __str__(self):
return '{} - {}'.format(self.bank_name, self.bank_account_number)
return '{}: {} - {}'.format(self.bank_name, self.bank_code_number, self.bank_account_number)
class Category(db_models.Model):
......@@ -155,7 +156,7 @@ class Product(db_models.Model):
upload_to=utils.get_upload_file_path,
verbose_name=_('image')
)
total_profit= db_models.DecimalField(
total_profit = db_models.DecimalField(
blank=True,
null=True,
default=decimal.Decimal('0'),
......@@ -164,7 +165,22 @@ class Product(db_models.Model):
validators=[validators.MinValueValidator(decimal.Decimal('0.01'))],
verbose_name=_('total profit')
)
is_hampers = db_models.BooleanField(default=False, verbose_name=_('the product is hampers package'))
hampers_price = db_models.DecimalField(
decimal_places=2,
default=decimal.Decimal('0.00'),
max_digits=12,
validators=[validators.MinValueValidator(decimal.Decimal('0.00'))],
verbose_name=_('hampers price')
)
unit = db_models.CharField(default='buah', max_length=200, verbose_name=_('unit'))
preorder = db_models.BooleanField(blank=True, null=True, default=False, verbose_name=_('preorder'))
preorder_duration = db_models.PositiveIntegerField(
blank=True,
null=True,
default=0,
verbose_name=_('preorder duration')
)
class Meta:
ordering = ['subcategory', 'name', 'code', 'id']
verbose_name = _('product')
......@@ -202,6 +218,7 @@ class CartItem(db_models.Model):
verbose_name=_('product')
)
quantity = db_models.PositiveIntegerField(default=0, verbose_name=_('quantity'))
hampers_messages = db_models.CharField(default='', max_length=100, verbose_name=_('hampers messages'))
class Meta:
ordering = ['shopping_cart', 'product', 'id']
......@@ -317,6 +334,12 @@ class Transaction(db_models.Model):
null=True,
verbose_name=_('transfer destination bank account number')
)
transfer_destination_bank_code_number = db_models.CharField(
blank=True,
max_length=100,
null=True,
verbose_name=_('transfer destination bank code number')
)
created_at = db_models.DateTimeField(
auto_now_add=True,
db_index=True,
......@@ -371,7 +394,24 @@ class TransactionItem(db_models.Model):
validators=[validators.MinValueValidator(decimal.Decimal('0.01'))],
verbose_name=_('product price')
)
profit= db_models.DecimalField(
blank=True,
null=True,
default=decimal.Decimal('0'),
decimal_places=2,
max_digits=12,
validators=[validators.MinValueValidator(decimal.Decimal('0.01'))],
verbose_name=_('total profit')
)
hampers_price = db_models.DecimalField(
default=decimal.Decimal('0.00'),
decimal_places=2,
max_digits=12,
validators=[validators.MinValueValidator(decimal.Decimal('0.00'))],
verbose_name=_('hampers price')
)
hampers_messages = db_models.CharField(default='', max_length=100, verbose_name=_('hampers messages'))
quantity = db_models.PositiveIntegerField(verbose_name=_('quantity'))
class Meta:
......@@ -525,6 +565,12 @@ class ProgramDonation(db_models.Model):
max_length=100,
verbose_name=_('transfer destination bank account number')
)
transfer_destination_bank_code_number = db_models.CharField(
blank=True,
null=True,
max_length=100,
verbose_name=_('transfer destination bank code number')
)
goods_quantity = db_models.DecimalField(
blank=True,
null=True,
......
......@@ -122,8 +122,8 @@ def transaction_or_donation_user_username_with_hyperlink(worksheet, row, col, ob
def transaction_transaction_item_subtotal(worksheet, row, col, obj, cell_format):
worksheet.write_number(row, col, sum(
transaction_item.product_price * transaction_item.quantity
for transaction_item in obj.transaction_items.all()
(transaction_item.product_price + transaction_item.hampers_price)
* transaction_item.quantity for transaction_item in obj.transaction_items.all()
), cell_format=cell_format)
......@@ -246,6 +246,8 @@ def create_transaction_report(filter_params): # pylint: disable=too-many-locals
(transaction_item_transaction_transaction_number_with_hyperlink, _('Transaction Number')),
('product_name', _('Product Name')),
('product_price', _('Product Price')),
('hampers_price', _('Hampers Price')),
('hampers_messages', _('Hampers Messages')),
('quantity', _('Quantity')),
]
write_queryset_data_to_worksheet(
......@@ -253,7 +255,10 @@ def create_transaction_report(filter_params): # pylint: disable=too-many-locals
models.TransactionItem.objects.filter(transaction__in=transactions),
transaction_item_fields,
header_format=header_format,
data_format={'product_price': money_format},
data_format={
'product_price': money_format,
'hampers_price': money_format
},
col_width=32
)
product_order_summary_worksheet = workbook.add_worksheet(str(_('Product Order Summary')))
......@@ -303,7 +308,7 @@ def create_transaction_report(filter_params): # pylint: disable=too-many-locals
return buffer
def create_program_donation_report_CSH(filter_params):
def create_program_donation_report_csh(filter_params):
buffer = io.BytesIO()
workbook = xlsxwriter.Workbook(
buffer,
......@@ -373,7 +378,7 @@ def create_program_donation_report_CSH(filter_params):
workbook.close()
return buffer
def create_program_donation_report_GDS(filter_params):
def create_program_donation_report_gds(filter_params):
buffer = io.BytesIO()
workbook = xlsxwriter.Workbook(
buffer,
......
......@@ -18,7 +18,8 @@ USER_DATA = {
BANK_ACCOUNT_TRANSFER_DESTINATION = {
'bank_name': 'Dummy Bank Name',
'bank_account_number': 'Dummy Bank Account Number',
'bank_code_number': '011',
'bank_account_number': '123456789',
'bank_account_name': 'Dummy Bank Account Name',
}
......@@ -37,6 +38,10 @@ PRODUCT_DATA = {
'stock': 10,
'modal': '1000',
'unit': 'kg',
'is_hampers': True,
'hampers_price': '500',
'preorder' : True,
'preorder_duration' : 5,
}
TRANSACTION_DATA = {
......@@ -46,6 +51,7 @@ TRANSACTION_DATA = {
}
TRANSACTION_ITEM_DATA = {
'profit' : 1000,
'quantity': 1,
}
......
......@@ -20,6 +20,11 @@ class OTPSerializer(serializers.Serializer): # pylint: disable=abstract-method
class CartUpdateSerializer(serializers.Serializer): # pylint: disable=abstract-method
product = serializers.UUIDField(label=_('Product'))
quantity = serializers.IntegerField(label=_('Quantity'), min_value=0)
hampers_messages = serializers.CharField(
label=_('Hampers Messages'),
max_length=100,
required=False
)
class CartCheckoutSerializer(serializers.Serializer): # pylint: disable=abstract-method
......@@ -223,7 +228,7 @@ class UserSerializer(serializers.ModelSerializer):
class BankAccountTransferDestinationSerializer(serializers.ModelSerializer):
class Meta:
fields = ['id', 'bank_name', 'bank_account_number', 'bank_account_name']
fields = ['id', 'bank_name', 'bank_code_number', 'bank_account_number','bank_account_name']
model = models.BankAccountTransferDestination
read_only_fields = ['id']
......@@ -265,7 +270,11 @@ class ProductSerializer(serializers.ModelSerializer):
'profit',
'image',
'total_profit',
'unit'
'unit',
'is_hampers',
'hampers_price',
'preorder',
'preorder_duration'
]
model = models.Product
read_only_fields = ['id', 'code']
......@@ -277,7 +286,7 @@ class CartItemSerializer(serializers.ModelSerializer):
product = ProductSerializer(read_only=True)
class Meta:
fields = ['id', 'product', 'quantity']
fields = ['id', 'product', 'quantity', 'hampers_messages']
model = models.CartItem
read_only_fields = ['id', 'quantity']
......@@ -294,7 +303,8 @@ class ShoppingCartSerializer(serializers.ModelSerializer):
def get_cart_item_subtotal(self, obj): # pylint: disable=no-self-use
cart_item_subtotal = sum(
cart_item.product.price * cart_item.quantity for cart_item in obj.cart_items.all()
(cart_item.product.price + cart_item.product.hampers_price)
* cart_item.quantity for cart_item in obj.cart_items.all()
)
return str(cart_item_subtotal)
......@@ -309,6 +319,8 @@ class TransactionItemSerializer(serializers.ModelSerializer):
'product_code',
'product_name',
'product_price',
'hampers_price',
'hampers_messages',
'quantity',
]
model = models.TransactionItem
......@@ -317,6 +329,7 @@ class TransactionItemSerializer(serializers.ModelSerializer):
'product',
'product_name',
'product_price',
'hampers_price',
'quantity',
]
......@@ -356,6 +369,7 @@ class TransactionSerializer(serializers.ModelSerializer):
'bank_account_transfer_destination',
'transfer_destination_bank_name',
'transfer_destination_bank_account_name',
'transfer_destination_bank_code_number',
'transfer_destination_bank_account_number',
'created_at',
'updated_at',
......@@ -387,6 +401,7 @@ class TransactionSerializer(serializers.ModelSerializer):
'bank_account_transfer_destination',
'transfer_destination_bank_name',
'transfer_destination_bank_account_name',
'transfer_destination_bank_code_number',
'transfer_destination_bank_account_number',
'created_at',
'updated_at',
......@@ -403,8 +418,8 @@ class TransactionSerializer(serializers.ModelSerializer):
def get_transaction_item_subtotal(self, obj): # pylint: disable=no-self-use
transaction_item_subtotal = sum(
transaction_item.product_price * transaction_item.quantity
for transaction_item in obj.transaction_items.all()
(transaction_item.product_price + transaction_item.hampers_price)
* transaction_item.quantity for transaction_item in obj.transaction_items.all()
)
return str(transaction_item_subtotal)
......@@ -425,6 +440,7 @@ class TransactionSerializer(serializers.ModelSerializer):
class ProgramSerializer(serializers.ModelSerializer):
total_donation_amount = serializers.SerializerMethodField('get_total_donation_amount')
goods_donation = serializers.SerializerMethodField('get_list_goods_donation')
class Meta:
fields = [
......@@ -441,6 +457,7 @@ class ProgramSerializer(serializers.ModelSerializer):
'poster_image',
'link',
'total_donation_amount',
'goods_donation',
]
model = models.Program
read_only_fields = ['id', 'code']
......@@ -453,6 +470,16 @@ class ProgramSerializer(serializers.ModelSerializer):
)
)
return str(total_donation_amount)
def get_list_goods_donation(self, obj):
lst = obj.program_donations.filter(
donation_status='002',
donation_type='GDS'
)
lst_ret = []
for goods_donation in lst:
dct = {'id' : goods_donation.id, 'desc' : goods_donation.goods_description, 'quantity' : goods_donation.goods_quantity}
lst_ret.append(dct)
return lst_ret
def validate(self, attrs):
instance = self.instance
......@@ -485,7 +512,6 @@ class ProgramProgressSerializer(serializers.ModelSerializer):
def validate(self, attrs):
instance = self.instance
date = attrs.get('date', getattr(instance, 'date', None))
errors = {}
if errors:
raise serializers.ValidationError(errors)
......@@ -520,6 +546,7 @@ class ProgramDonationSerializer(serializers.ModelSerializer):
'bank_account_transfer_destination',
'transfer_destination_bank_name',
'transfer_destination_bank_account_name',
'transfer_destination_bank_code_number',
'transfer_destination_bank_account_number',
'goods_quantity',
'goods_description',
......@@ -545,6 +572,7 @@ class ProgramDonationSerializer(serializers.ModelSerializer):
'bank_account_transfer_destination',
'transfer_destination_bank_name',
'transfer_destination_bank_account_name',
'transfer_destination_bank_code_number',
'transfer_destination_bank_account_number',
'created_at',
'updated_at',
......
......@@ -3,6 +3,7 @@ from django.db.models import signals
from api import models, utils
@dispatch.receiver(signals.post_save, sender=models.User)
def create_shopping_cart(sender, created, instance, **_kwargs): # pylint: disable=unused-argument
if created:
......@@ -40,6 +41,7 @@ def fill_dependent_transaction_fields(sender, instance, **_kwargs):
if instance.bank_account_transfer_destination is None:
instance.transfer_destination_bank_name = None
instance.transfer_destination_bank_account_name = None
instance.transfer_destination_bank_code_number = None
instance.transfer_destination_bank_account_number = None
else:
instance.transfer_destination_bank_name = (
......@@ -51,6 +53,9 @@ def fill_dependent_transaction_fields(sender, instance, **_kwargs):
instance.transfer_destination_bank_account_number = (
instance.bank_account_transfer_destination.bank_account_number
)
instance.transfer_destination_bank_code_number = (
instance.bank_account_transfer_destination.bank_code_number
)
if (instance.transaction_status == '002'):
if instance.batch is None:
......@@ -71,10 +76,14 @@ def fill_dependent_transaction_item_fields(sender, instance, **_kwargs):
if instance.product is None:
instance.product_name = None
instance.product_price = None
instance.hampers_price = None
instance.hampers_messages = None
else:
instance.product_name = instance.product.name
instance.product_price = instance.product.price
instance.hampers_price = instance.hampers_price
instance.hampers_messages = instance.hampers_messages
......
import datetime
import decimal
from os import name
import tempfile
import uuid
from os import name
from unittest import mock
import datetime
import jwt
from django import conf, test as django_test, urls
from django import conf
from django import test as django_test
from django import urls
from django.core import management
from PIL import Image
from rest_framework import exceptions, status, test as rest_framework_test
from django.utils import timezone
from api import models, seeds, utils, views
import uuid
from PIL import Image
from rest_framework import exceptions, status
from rest_framework import test as rest_framework_test
from api import models, seeds, utils, views
def create_tmp_image():
......@@ -299,6 +304,7 @@ class CartTest(rest_framework_test.APITestCase): # pylint: disable=too-many-inst
data = {
'product': self.product.id,
'quantity': 1,
'hampers_messages': 'Selamat Lebaran',
}
response = request(
'POST',
......@@ -333,6 +339,7 @@ class CartTest(rest_framework_test.APITestCase): # pylint: disable=too-many-inst
data = {
'product': self.product.id,
'quantity': 1,
'hampers_messages': 'Selamat Lebaran',
}
response = request(
'POST',
......@@ -387,6 +394,7 @@ class CartTest(rest_framework_test.APITestCase): # pylint: disable=too-many-inst
data = {
'product': self.product.id,
'quantity': 20,
'hampers_messages': 'Selamat Lebaran',
}
request(
'POST',
......@@ -411,6 +419,7 @@ class CartTest(rest_framework_test.APITestCase): # pylint: disable=too-many-inst
data = {