2017-07-13 15:07:51 +05:30
|
|
|
import unittest
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2017-07-13 15:07:51 +05:30
|
|
|
import frappe
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2017-07-13 15:07:51 +05:30
|
|
|
import erpnext
|
2021-09-02 16:44:59 +05:30
|
|
|
|
2017-07-13 15:07:51 +05:30
|
|
|
|
2017-07-13 15:49:37 +05:30
|
|
|
@erpnext.allow_regional
|
2017-07-13 15:07:51 +05:30
|
|
|
def test_method():
|
|
|
|
return "original"
|
2022-03-28 18:52:46 +05:30
|
|
|
|
2017-07-13 15:07:51 +05:30
|
|
|
|
|
|
|
class TestInit(unittest.TestCase):
|
|
|
|
def test_regional_overrides(self):
|
2018-03-09 13:11:00 +05:30
|
|
|
frappe.flags.country = "Maldives"
|
|
|
|
self.assertEqual(test_method(), "original")
|
2018-02-21 06:37:33 +01:00
|
|
|
|
|
|
|
frappe.flags.country = "France"
|
2018-03-09 13:11:00 +05:30
|
|
|
self.assertEqual(test_method(), "overridden")
|