lundi 2 janvier 2017

Port is not being set when running Flask and Flask-Restplus unittests

I have been messing around with a stupid problem for the last few hours. When I run my Flask-Restplus unittest the port is not being added to the base URL.

response = self.test_app.get('/api/v1_0/work/users/1',
                                     content_type='application/json')

I have to explicitly set the baseUrl parameter.

response = self.test_app.get('/api/v1_0/work/users/1',
                                     content_type='application/json',
                                     base_url=self.base_url)

All other unittests run fine.

I have the server and port set in the configuration file.

SERVER_HOST = "localhost"
SERVER_PORT = 8080

Any ideas/suggestions?

Regards, nidkil

Aucun commentaire:

Enregistrer un commentaire