Top "Django-testing" questions

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

How to use pdb.set_trace() in a Django unittest?

I want to debug a Django TestCase just like I would any other Python code: Simply call pdb.set_trace() …

django debugging django-testing pdb
Django testing stored session data in tests

I have a view as such: def ProjectInfo(request): if request.method == 'POST': form = ProjectInfoForm(request.POST) if form.is_…

django django-testing
How to test url in django

I would like to test my url in django but I got error message. here are my codes: urls.py …

python django testing django-urls django-testing
Can i access the response context of a view tested without the test client?

I have a function which i call from a unittest. From setting some debug traces i know the function worked …

django django-views django-testing
Factory Boy random choice for a field with field option "choices"

When a field in a Django model has the option choices, see Django choices field option, it utilises an iterable …

python django factory django-testing factory-boy
How to test a Django model with pytest?

I am getting started with pytest. I have configured pytest, anyway I couldn't found a resource on Django specific testing …

python django pytest django-testing pytest-django
django how to see sql query when running tests?

One of my django application unit test fails with DatabaseError: ORA-00942: table or view does not exist I would like …

sql django oracle unit-testing django-testing
Mock a model method in Django

I'm just getting started with Mock for testing Django apps without touching the db. I can successfully mock my model …

django unit-testing django-models django-testing django-tests
Many-to-many relationship in factory_boy?

I'm trying to test a many-to-many relationship between two Django models using factory_boy. The factory_boy documentation doesn't appear …

unit-testing django-testing factory-boy
Assert that two lists of objects are equal in django testing

Is there a way to check that two lists of objects are equal in django tests. lets say I have …

django django-testing django-tests