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