Commit d88b9d7b authored by Patrick Kimber's avatar Patrick Kimber

Fix issue with the payment processor (it does not have a 'slug')

parent 3e7cedcd
......@@ -158,8 +158,8 @@ class TimeRecordForm(RequiredFieldForm):
class SlugModelChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
return obj.slug
def label_from_instance(self, x):
return x.slug
class SearchForm(forms.Form):
......@@ -169,7 +169,7 @@ class SearchForm(forms.Form):
currency = SlugModelChoiceField(
label="Currency", queryset=Currency.objects.none(), required=False
)
payment_processor = SlugModelChoiceField(
payment_processor = forms.ModelChoiceField(
label="Payment",
queryset=PaymentProcessor.objects.none(),
required=False,
......
......@@ -18,6 +18,7 @@ from invoice.tests.factories import (
InvoiceFactory,
InvoiceIssueFactory,
InvoiceSettingsFactory,
PaymentProcessorFactory,
TimeRecordFactory,
)
from login.tests.factories import TEST_PASSWORD, UserFactory
......@@ -256,6 +257,7 @@ def test_invoice_list(client):
InvoiceFactory()
InvoiceFactory()
InvoiceFactory()
PaymentProcessorFactory()
assert client.login(username=user.username, password=TEST_PASSWORD) is True
response = client.get(reverse("invoice.list"))
assert HTTPStatus.OK == response.status_code
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment