vendredi 30 janvier 2015

Django unit tests mock

I am writing Django tests of one application and I came to the mock lib which I never used before. The problem is I need the response from server (the server is not actually there) if it is online or not. First of all I need to check that server id and ip and then check the state of it with the response of TRUE or FALSE. Server.object should come from models.py so I guess I need to start using mock lib here. The question is maybe some of you could explain me or show me few examples of getting fake response from 'mock'server.


Aucun commentaire:

Enregistrer un commentaire