I try to create some Integration tests to test a view in my django project. In my view I create a ModelForm with a prefix
customer_form = CustomerForm(request.POST or None, prefix="customer", instance=customer)
I am trying the following code on my Integration test using django client.
response = self.client.get(reverse("customer_edit", kwargs={"customer_id":customer_id})
customer_form = response.context["customer_form"]
data = customer_form.data
prefix = cutomer_form.prefix
self.client.post(reverse("customer-edit", kwargs={"customer_id":customer_id}, data, follow=True)
But in my view when I am checking if customer_form is valid i get that it isn't. customer_form.errors has all required fields, although data dictionary contains the values. Does django do something different when prefix is set up on a modelform?