Learn how to write integration tests (testing views, URL routing, middleware, and models).
- [Instructor] We'll learn how to use…Django's built-in test client,…for a little bit of integration testing…to make sure your whole project works together.…In this video we're going to learn how…to test our views in isolation.…We're also going to learn…how to test helper functions on our view classes.…We're going to learn how to test our view response object…and how to test for failure on views.…Let's hop right into some code.…We'll start by opening up our test view file.…Just like in our previous tests,…we're importing test case and model mommy right off the bat.…
However, for this test case,…we're also going to import Django.test client.…Django provides a great test client…that makes integration testing far easier than it could be.…We're also going to import Django.urls reverse.…Reverse is a great function that Django provides,…so that we don't have to provide actual URLs,…we can just provide the named attribute…that we gave them in the urls.py file.…This helps future-proof our test so that we don't have…to come back and change URLs if our production environment…
- Extending class-based views
- Building a REST API
- Working with GraphQL
- Building a basic schema
- Optimizing your environment
- Working with Pipenv
- How Django handles testing
- Securing the Django admin
Skill Level Advanced
1. Advanced Class-Based Views
2. Building a REST API
Authentication with DRF6m 14s
3. GraphQL: An Alternative API
4. Optimizing Your Environment
5. Tests, Tests, Tests
6. Securing Django
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.