Rushabh Mehta | 8f2e21d | 2017-07-13 15:07:51 +0530 | [diff] [blame] | 1 | import unittest, frappe, erpnext |
| 2 | |
Rushabh Mehta | 393becc | 2017-07-13 15:49:37 +0530 | [diff] [blame] | 3 | @erpnext.allow_regional |
Rushabh Mehta | 8f2e21d | 2017-07-13 15:07:51 +0530 | [diff] [blame] | 4 | def test_method(): |
| 5 | return 'original' |
| 6 | |
| 7 | class TestInit(unittest.TestCase): |
| 8 | def test_regional_overrides(self): |
| 9 | frappe.flags.country = 'India' |
| 10 | self.assertEqual(test_method(), 'overridden') |
| 11 | |
Nabin Hait | 096c05c | 2018-03-09 13:11:00 +0530 | [diff] [blame] | 12 | frappe.flags.country = 'Maldives' |
| 13 | self.assertEqual(test_method(), 'original') |
Charles-Henri Decultot | b8c088e | 2018-02-21 06:37:33 +0100 | [diff] [blame] | 14 | |
| 15 | frappe.flags.country = 'France' |
Nabin Hait | 096c05c | 2018-03-09 13:11:00 +0530 | [diff] [blame] | 16 | self.assertEqual(test_method(), 'overridden') |