def METHOD_NAME(app: Devicehub):
    """Tests creating an user through the main method.
    This method checks that the token is correct, too.
    """
    user_def = app.resources['User']  # type: UserDef
    u = user_def.create_user(
        email='foo@foo.com',
        password='foo',
        agent='Nice Person',
        country=Country.ES.name,
        telephone='+34 666 66 66 66',
        tax_id='1234',
    )
    user = User.query.filter_by(id=u['id']).one()  # type: User
    assert user.email == 'foo@foo.com'
    assert isinstance(user.token, UUID)
    assert User.query.filter_by(email='foo@foo.com').one() == user
    individual = next(iter(user.individuals))
    assert individual.name == 'Nice Person'
    assert individual.tax_id == '1234'
    assert individual.telephone.e164 == '+34666666666'
    assert individual.country == Country.ES
    assert individual.email == user.email