@@ -372,18 +372,17 @@ def test_block_tax_changing_address_after_submit(self):
372372 purchase = supplier (re-synced here, so the supplier change alone flips it)."""
373373 doc = create_transaction (** self .transaction_details , is_in_state = True )
374374 doc .reload ()
375- doc .load_doc_before_save ()
376375
377376 if self .is_sales_doctype :
378377 doc .customer_address = "_Test Registered Customer-Billing-3" # Karnataka (29)
379378 doc .place_of_supply = "29-Karnataka"
380379 else :
381380 doc .supplier_address = "_Test Registered Supplier-Billing-3" # Karnataka (29)
382381
383- self .assertRaises (
382+ self .assertRaisesRegex (
384383 frappe .exceptions .ValidationError ,
385- sync_address_dependent_fields_on_submit ,
386- doc ,
384+ "Cannot charge CGST/SGST for inter-state supplies" ,
385+ doc . save ,
387386 )
388387
389388 def test_block_pos_change_to_different_state_after_submit (self ):
@@ -395,13 +394,12 @@ def test_block_pos_change_to_different_state_after_submit(self):
395394 if doc .place_of_supply == "27-Maharashtra" :
396395 return
397396
398- doc .load_doc_before_save ()
399397 doc .place_of_supply = "27-Maharashtra"
400398
401- self .assertRaises (
399+ self .assertRaisesRegex (
402400 frappe .exceptions .ValidationError ,
403- sync_address_dependent_fields_on_submit ,
404- doc ,
401+ "Cannot charge CGST/SGST for inter-state supplies" ,
402+ doc . save ,
405403 )
406404
407405 def test_allow_tax_neutral_pos_change_after_submit (self ):
@@ -442,13 +440,12 @@ def test_block_gst_category_change_after_submit(self):
442440 address_field = "supplier_address"
443441 new_address = "_Test Registered Supplier-Billing-2"
444442
445- doc .load_doc_before_save ()
446443 doc .set (address_field , new_address )
447444
448- self .assertRaises (
445+ self .assertRaisesRegex (
449446 frappe .exceptions .ValidationError ,
450- sync_address_dependent_fields_on_submit ,
451- doc ,
447+ "GST Category cannot be set to" ,
448+ doc . save ,
452449 )
453450
454451 def test_block_address_or_pos_change_when_ewaybill_or_irn_exists (self ):
@@ -460,16 +457,15 @@ def test_block_address_or_pos_change_when_ewaybill_or_irn_exists(self):
460457
461458 doc = create_transaction (** self .transaction_details )
462459 doc .reload ()
463- doc .load_doc_before_save ()
464460
465461 # fake an e-Waybill / IRN, then a tax-neutral POS edit
466462 doc .set (ewb_field , "123456789012" if ewb_field == "ewaybill" else "a" * 64 )
467463 doc .place_of_supply = "27-Maharashtra" if doc .place_of_supply != "27-Maharashtra" else "29-Karnataka"
468464
469- self .assertRaises (
465+ self .assertRaisesRegex (
470466 frappe .exceptions .ValidationError ,
471- sync_address_dependent_fields_on_submit ,
472- doc ,
467+ "Cannot change the Place of Supply or address after the e-Waybill" ,
468+ doc . save ,
473469 )
474470
475471 def test_validate_mandatory_gst_category (self ):
0 commit comments