It's time to add data to your site. In this video, learn how to add a test for it.
- [Instructor] The next text that we want to create … is testing our hash object … that we just created in our models. … So let's go ahead and move over to our test file … and create a new function where we can test that object. … So, as far as naming this, let's go ahead … and call it something like def. … We'll start with test, remember, … we always have to start with test, … and we'll call this test_hash_object. … It has self inside of there. … Now because we're going to be working with the hash object, … we got to make sure that we import it. … So at the top of the file here, … let's go ahead and add a … from dot models import capital Hash, … and if we go back to our models.py, … you can see that that's going to match up exactly … with the name of that class there. … So we'll go ahead and scroll down. … As far as running this test, … what are the things that we're looking for? … Well, we'll want to create a hash object. … So let's start with that. … We'll just say hash, in lowercase, is equal to capital Hash. …
- TDD philosophy
- Comparing functional and unit tests
- Writing a test in Selenium
- Writing a unit test
- Testing page data
- Hash testing
- Writing a test for user input
- Testing a POST request
- AJAX implementation
- TDD vs. testing after
Skill Level Intermediate
Deploying Django Apps: Make Your Site Go Livewith Nick Walter2h 43m Intermediate
Building RESTful Web APIs with Djangowith Rudolf Olah1h 9m Intermediate
What you should know1m 9s
1. Functional Tests
2. Unit Tests
3. Advanced Testing
Next steps1m 11s
- 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.