2021-09-02 11:14:59 +00:00
|
|
|
import unittest
|
|
|
|
|
|
|
|
import frappe
|
|
|
|
|
|
|
|
import erpnext
|
|
|
|
|
2017-07-13 09:37:51 +00:00
|
|
|
|
2017-07-13 10:19:37 +00:00
|
|
|
@erpnext.allow_regional
|
2017-07-13 09:37:51 +00:00
|
|
|
def test_method():
|
2022-03-28 13:22:46 +00:00
|
|
|
return "original"
|
|
|
|
|
2017-07-13 09:37:51 +00:00
|
|
|
|
|
|
|
class TestInit(unittest.TestCase):
|
|
|
|
def test_regional_overrides(self):
|
2022-03-28 13:22:46 +00:00
|
|
|
frappe.flags.country = "India"
|
|
|
|
self.assertEqual(test_method(), "overridden")
|
2017-07-13 09:37:51 +00:00
|
|
|
|
2022-03-28 13:22:46 +00:00
|
|
|
frappe.flags.country = "Maldives"
|
|
|
|
self.assertEqual(test_method(), "original")
|
2018-02-21 05:37:33 +00:00
|
|
|
|
2022-03-28 13:22:46 +00:00
|
|
|
frappe.flags.country = "France"
|
|
|
|
self.assertEqual(test_method(), "overridden")
|