def setUp(self): """Set the environment for the tests up.""" super().setUp() self.projects = ProjectFactory.create_batch(10) ProjectFactory.create_batch(10, archived=True)
def test_subscription_package_filter_customer(auth_client): customer = CustomerFactory.create() billing_type = BillingTypeFactory.create() package = PackageFactory.create(billing_type=billing_type) ProjectFactory.create_batch(2, billing_type=billing_type, customer=customer) url = reverse("subscription-package-list") res = auth_client.get(url, data={"customer": customer.id}) assert res.status_code == HTTP_200_OK json = res.json() assert len(json["data"]) == 1 assert json["data"][0]["id"] == str(package.id)