def test_phone(self):
        value = self.sd.phone(locale='es')
        self.assertTrue(isinstance(value, six.string_types))
        self.assertEqual(len(value), 9)
        self.assertTrue(value[0] in ['6', '9'])

        value = self.sd.phone(locale='es', country_code=True)
        self.assertTrue(isinstance(value, six.string_types))
        self.assertEqual(len(value), 13)
        self.assertTrue(['+34 6', '+34 9'] in value[0:5])

        with self.assertRaises(ParameterError):
            value = self.sd.phone(locale="not-valid-locale")
dataset/ETHPy150Open kaleidos/django-sampledatahelper/tests/tests.py/TestLocalizedHelpers.test_phone/swapped operands of `in`