Chillar Anand | 915b343 | 2021-09-02 16:44:59 +0530 | [diff] [blame] | 1 | import unittest |
| 2 | |
| 3 | import frappe |
| 4 | |
| 5 | import erpnext |
| 6 | |
Rushabh Mehta | 8f2e21d | 2017-07-13 15:07:51 +0530 | [diff] [blame] | 7 | |
Rushabh Mehta | 393becc | 2017-07-13 15:49:37 +0530 | [diff] [blame] | 8 | @erpnext.allow_regional |
Rushabh Mehta | 8f2e21d | 2017-07-13 15:07:51 +0530 | [diff] [blame] | 9 | def test_method(): |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 10 | return "original" |
| 11 | |
Rushabh Mehta | 8f2e21d | 2017-07-13 15:07:51 +0530 | [diff] [blame] | 12 | |
| 13 | class TestInit(unittest.TestCase): |
| 14 | def test_regional_overrides(self): |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 15 | frappe.flags.country = "Maldives" |
| 16 | self.assertEqual(test_method(), "original") |
Charles-Henri Decultot | b8c088e | 2018-02-21 06:37:33 +0100 | [diff] [blame] | 17 | |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 18 | frappe.flags.country = "France" |
| 19 | self.assertEqual(test_method(), "overridden") |