@@ -155,6 +155,10 @@ class Meta:
155155class ReceiptWithVatAndTaxFactory (ReceiptFactory ):
156156 """Receipt with a valid Vat and Tax, ready to validate."""
157157
158+ class Meta :
159+ model = models .Receipt
160+ skip_postgeneration_save = False # Remove on pytest >= 10.0
161+
158162 point_of_sales = LazyFunction (lambda : models .PointOfSales .objects .first ()) # type: ignore[assignment]
159163 client_vat_condition = SubFactory (ClientVatConditionFactory )
160164
@@ -177,6 +181,10 @@ class ReceiptFCEAWithVatAndTaxFactory(ReceiptWithVatAndTaxFactory):
177181class ReceiptFCEAWithVatTaxAndOptionalsFactory (ReceiptFCEAWithVatAndTaxFactory ):
178182 """Receipt FCEA with a valid Vat, Tax and Optionals, ready to validate."""
179183
184+ class Meta :
185+ model = models .Receipt
186+ skip_postgeneration_save = False # Remove on pytest >= 10.0
187+
180188 total_amount = 13_000_000
181189 net_untaxed = 0
182190 net_taxed = 10_000_000
@@ -204,6 +212,10 @@ def post(obj: models.Receipt, create: bool, extracted: None, **kwargs) -> None:
204212class ReceiptWithInconsistentVatAndTaxFactory (ReceiptWithVatAndTaxFactory ):
205213 """Receipt with a valid Vat and Tax, ready to validate."""
206214
215+ class Meta :
216+ model = models .Receipt
217+ skip_postgeneration_save = False # Remove on pytest >= 10.0
218+
207219 document_type = SubFactory (DocumentTypeFactory , code = 80 )
208220
209221 @post_generation
@@ -215,6 +227,10 @@ def post(obj: models.Receipt, create: bool, extracted: None, **kwargs) -> None:
215227class ReceiptWithApprovedValidation (ReceiptFactory ):
216228 """Receipt with fake (e.g.: not live) approved validation."""
217229
230+ class Meta :
231+ model = models .Receipt
232+ skip_postgeneration_save = False # Remove on pytest >= 10.0
233+
218234 receipt_number = Sequence (lambda n : n + 1 )
219235
220236 @post_generation
@@ -248,6 +264,12 @@ class Meta:
248264
249265
250266class ReceiptPDFWithFileFactory (ReceiptPDFFactory ):
267+ """ReceiptPDF with an actual PDF file generated."""
268+
269+ class Meta :
270+ model = models .ReceiptPDF
271+ skip_postgeneration_save = False # Remove on pytest >= 10.0
272+
251273 receipt = SubFactory (ReceiptWithApprovedValidation )
252274
253275 @post_generation
@@ -335,6 +357,10 @@ class Meta:
335357class ReceiptWithClientVatConditionFactory (ReceiptFactory ):
336358 """Receipt with a valid Client VAT Condition, ready to validate."""
337359
360+ class Meta :
361+ model = models .Receipt
362+ skip_postgeneration_save = False # Remove on pytest >= 10.0
363+
338364 client_vat_condition = SubFactory (ClientVatConditionFactory )
339365
340366 @post_generation
0 commit comments