mardi 24 octobre 2017

Testing a utility method that doesn't belong to a class in django

I have a file I created called utils.py

In that I have a few little methods that don't really belong on a model, they don't really belong in the view.

They don't do a lot of work and are just used once or twice in my application so I felt they best fit into a 'utility' kind of role.

My question is - how do I test them?

I currently test my models and forms - but I wanted to put together some tests to go against this utils file, too. I just don't know how to do that without a class to call in the test_utils.py file

Aucun commentaire:

Enregistrer un commentaire