Reputation: 1642
I will start writing my tests.py for a small app I developed using what I learned in Django Tutorial 5. I have not used Selenium before. Therefore, I am not sure if I should learn Selenium first then write my tests.py ? Or write my tests.py first then incorporate Selenium into the tests.py after ?
When does Selenium and Django Client Test go hand in hand ? And when does one outweigh the other ?
Upvotes: 1
Views: 529
Reputation: 671
Ask yourself what do you need to test. What did you write that needs testing?
Selenium is a tool to automate browsers and is commonly used for functional testing, which is like testing the front-end of the application. With selenium, you aren't just testing the front-end really but also what the expected behavior of the back-end is.
The thing is that if you want to test your python code, the best thing is to write your tests with Django's testing modules like TestCase
and then test the models and/or views you have created.
When you are sure that your models and views are bug-free (that is something you cannot be 100% sure), go ahead and test with selenium.
I recommend you to have a look at this first:
https://realpython.com/testing-in-django-part-1-best-practices-and-examples/
Upvotes: 1