Here are the examples of the python api sqlalchemy_utils.PhoneNumberType taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
3
Example 1
@pytest.fixture
def User(Base):
class User(Base):
__tablename__ = 'user'
id = sa.Column(sa.Integer, autoincrement=True, primary_key=True)
name = sa.Column(sa.Unicode(255))
phone_number = sa.Column(PhoneNumberType())
return User
3
Example 2
Project: wtforms-alchemy Source File: test_types.py
@mark.xfail('phone_number.phonenumbers is None')
def test_phone_number_type_has_no_length_validation(self):
self.init(type_=PhoneNumberType(country_code='FI'))
field = self._get_field('test_column')
for validator in field.validators:
assert validator.__class__ != Length
0
Example 3
Project: sqlalchemy-utils Source File: test_phonenumber.py
def test_uses_phonenumber_class_as_python_type(self):
assert PhoneNumberType().python_type is PhoneNumber
0
Example 4
Project: wtforms-alchemy Source File: test_types.py
@mark.xfail('phone_number.phonenumbers is None')
def test_phone_number_country_code_passed_to_field(self):
self.init(type_=PhoneNumberType(region='SE'))
form = self.form_class()
assert form.test_column.region == 'SE'