Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests #78

Open
oussjarrousse opened this issue Dec 23, 2023 · 4 comments
Open

Add tests #78

oussjarrousse opened this issue Dec 23, 2023 · 4 comments

Comments

@oussjarrousse
Copy link

I suggest adding tests with PyTest.

If you like the idea, and you approves I will volunteer to create the boilerplate and the first few tests.

@mkalioby
Copy link
Owner

Sure but wont it better to use Django test

@oussjarrousse
Copy link
Author

Yes good point.

I have used both Django tests (based on unittest) as well as PyTest (with the pytest-django plugin) to add tests to Django projects.

My experience with PyTest is much better, not only in Django project, but also in all kinds of Python projects.

I think there are several reasons for that, for instance pytest makes organising tests much simpler and much flexible than unittest. It also make parameterising tests much simpler. It also more economic in terms of lines of code, and in case you already have tests written for unittest, pytest can still run them...

Here are two articles with some pros. of using pytest for testing Django:
https://djangostars.com/blog/django-pytest-testing/
https://jmr.pl/blog/pytest

I also want to refer you to this stackoverflow Q/A:
https://stackoverflow.com/questions/44558018/django-test-vs-pytest (note that the issue the author mentions with gitlab-ci.yaml is rather lack of experience of the author with pytest than a real issue... basically he does not know about tox or hatch)

@mkalioby
Copy link
Owner

mkalioby commented Dec 25, 2023 via email

@oussjarrousse
Copy link
Author

oussjarrousse commented Dec 27, 2023

I've created a pull request #79 that addresses this issue!
looking forward for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants