diff --git a/core/tests/test_user.py b/core/tests/test_user.py index 77ca0fe0..b90e626e 100644 --- a/core/tests/test_user.py +++ b/core/tests/test_user.py @@ -186,7 +186,9 @@ class TestFilterInactive(TestCase): time_active = now() - settings.SITH_ACCOUNT_INACTIVITY_DELTA + timedelta(days=1) time_inactive = time_active - timedelta(days=3) counter, seller = baker.make(Counter), baker.make(User) - sale_recipe = Recipe(Selling, counter=counter, club=counter.club, seller=seller) + sale_recipe = Recipe( + Selling, counter=counter, club=counter.club, seller=seller, unit_price=0 + ) cls.users = [ baker.make(User), diff --git a/counter/forms.py b/counter/forms.py index 5e144d44..1b59855a 100644 --- a/counter/forms.py +++ b/counter/forms.py @@ -146,7 +146,7 @@ class RefillForm(forms.ModelForm): class Meta: model = Refilling - fields = ["amount", "payment_method", "bank"] + fields = ["amount", "payment_method"] widgets = {"payment_method": forms.RadioSelect} def __init__(self, *args, **kwargs): @@ -160,9 +160,6 @@ class RefillForm(forms.ModelForm): if self.fields["payment_method"].initial not in self.allowed_refilling_methods: self.fields["payment_method"].initial = self.allowed_refilling_methods[0] - if "CHECK" not in self.allowed_refilling_methods: - del self.fields["bank"] - class CounterEditForm(forms.ModelForm): class Meta: diff --git a/counter/migrations/0035_remove_selling_is_validated_and_more.py b/counter/migrations/0035_remove_selling_is_validated_and_more.py index 83da9643..94513a43 100644 --- a/counter/migrations/0035_remove_selling_is_validated_and_more.py +++ b/counter/migrations/0035_remove_selling_is_validated_and_more.py @@ -20,6 +20,7 @@ class Migration(migrations.Migration): operations = [ migrations.RemoveField(model_name="selling", name="is_validated"), migrations.RemoveField(model_name="refilling", name="is_validated"), + migrations.RemoveField(model_name="refilling", name="bank"), migrations.RenameField( model_name="selling", old_name="payment_method", diff --git a/counter/models.py b/counter/models.py index f056102b..4f0bee12 100644 --- a/counter/models.py +++ b/counter/models.py @@ -747,13 +747,7 @@ class Refilling(models.Model): ) date = models.DateTimeField(_("date")) payment_method = models.CharField( - _("payment method"), - max_length=255, - choices=PAYMENT_METHOD, - default="CARD", - ) - bank = models.CharField( - _("bank"), max_length=255, choices=settings.SITH_COUNTER_BANK, default="OTHER" + _("payment method"), max_length=255, choices=PAYMENT_METHOD, default="CARD" ) objects = RefillingQuerySet.as_manager() diff --git a/counter/tests/test_counter.py b/counter/tests/test_counter.py index 45b7bb13..e30a2b43 100644 --- a/counter/tests/test_counter.py +++ b/counter/tests/test_counter.py @@ -119,11 +119,7 @@ class TestRefilling(TestFullClickBase): "counter:refilling_create", kwargs={"customer_id": user.pk}, ), - { - "amount": str(amount), - "payment_method": "CASH", - "bank": "OTHER", - }, + {"amount": str(amount), "payment_method": "CASH"}, HTTP_REFERER=reverse( "counter:click", kwargs={"counter_id": counter.id, "user_id": user.pk}, @@ -149,11 +145,7 @@ class TestRefilling(TestFullClickBase): "counter:refilling_create", kwargs={"customer_id": self.customer.pk}, ), - { - "amount": "10", - "payment_method": "CASH", - "bank": "OTHER", - }, + {"amount": "10", "payment_method": "CASH"}, ) self.client.force_login(self.club_admin) diff --git a/eboutic/models.py b/eboutic/models.py index a2054610..2a4e14b5 100644 --- a/eboutic/models.py +++ b/eboutic/models.py @@ -254,7 +254,6 @@ class Invoice(models.Model): operator=self.user, amount=i.product_unit_price * i.quantity, payment_method="CARD", - bank="OTHER", date=self.date, ) new.save() diff --git a/sith/settings.py b/sith/settings.py index 8647d8e9..7c6aab4e 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -440,19 +440,6 @@ SITH_SUBSCRIPTION_LOCATIONS = [ SITH_COUNTER_BARS = [(1, "MDE"), (2, "Foyer"), (35, "La Gommette")] -SITH_COUNTER_BANK = [ - ("OTHER", "Autre"), - ("SOCIETE-GENERALE", "Société générale"), - ("BANQUE-POPULAIRE", "Banque populaire"), - ("BNP", "BNP"), - ("CAISSE-EPARGNE", "Caisse d'épargne"), - ("CIC", "CIC"), - ("CREDIT-AGRICOLE", "Crédit Agricole"), - ("CREDIT-MUTUEL", "Credit Mutuel"), - ("CREDIT-LYONNAIS", "Credit Lyonnais"), - ("LA-POSTE", "La Poste"), -] - SITH_PEDAGOGY_UV_TYPE = [ ("FREE", _("Free")), ("CS", _("CS")),