import unittest
from visual_controls import _matches, approved_targets

class DropdownTests(unittest.TestCase):
 def test_country_exact(self):
  self.assertTrue(_matches('India','India','country'))
  self.assertFalse(_matches('India ( +91 )','India','country'))
 def test_dial_code(self):
  self.assertTrue(_matches('India (+91)','+91','code'))
  self.assertTrue(_matches('+91','+91','code'))
  self.assertFalse(_matches('+1','+91','code'))
 def test_approved_values(self):
  self.assertEqual(approved_targets({'country':'India','phone_country_code':'+91'}),('India','+91'))
