Ejemplo n.º 1
0
class TesteUserModel(TestCase):
    data = {
        "login": "******",
        "password": "******",
        "city": "Curitiba"
    }

    new_login = "******"
    new_password = "******"
    new_city = "São paulo"

    users = Users()
    user = User()
    user_register = UserRegister()
    user_update = UserUpdate()
    user_login = UserLogin()

    @app.route('/users')
    def test_list_users(self):
        assert self.users.get()

    with app.test_client() as client:
        response = client.get('/users')
        data = json.load(response.data)
        print
class TesteUserModel(TestCase):
    data = {
        "login": "******",
        "password": "******",
        "city": "Curitiba"
    }

    new_login = "******"
    new_password = "******"
    new_city = "São paulo"

    users = Users()
    user = User()
    user_register = UserRegister()
    user_update = UserUpdate()
    user_login = UserLogin()

    #     @app.route('/users')
    #     def test_list_users():
    #         print('test')
    #         # assert self.users.get()

    # # if __name__ == '__main__':
    # with app.test_client() as client:
    #     client.get('/users')@app.route('/')
    def hello():
        print('during view')
        return 'Hello, World!'

    @app.teardown_request
    def show_teardown(exception):
        print('after with block')
class TesteUserModel(TestCase):
    data = {
        "login": "******",
        "password": "******",
        "city": "Curitiba"
    }

    new_login = "******"
    new_password = "******"
    new_city = "São paulo"

    users = Users()
    user = User()
    user_register = UserRegister()
    user_update = UserUpdate()
    user_login = UserLogin()

    @app.route('/users')
    def test_list_users(self):