2019-01-22 12:52:20 +00:00
|
|
|
from __future__ import unicode_literals
|
2017-07-13 09:37:51 +00:00
|
|
|
import unittest, frappe, erpnext
|
|
|
|
|
2017-07-13 10:19:37 +00:00
|
|
|
@erpnext.allow_regional
|
2017-07-13 09:37:51 +00:00
|
|
|
def test_method():
|
|
|
|
return 'original'
|
|
|
|
|
|
|
|
class TestInit(unittest.TestCase):
|
|
|
|
def test_regional_overrides(self):
|
|
|
|
frappe.flags.country = 'India'
|
|
|
|
self.assertEqual(test_method(), 'overridden')
|
|
|
|
|
2018-03-09 07:41:00 +00:00
|
|
|
frappe.flags.country = 'Maldives'
|
|
|
|
self.assertEqual(test_method(), 'original')
|
2018-02-21 05:37:33 +00:00
|
|
|
|
|
|
|
frappe.flags.country = 'France'
|
2021-08-19 08:11:10 +00:00
|
|
|
self.assertEqual(test_method(), 'overridden')
|