Tsallaka zuwa abun ciki
Justice Tech School

Testing

TestCase runs tests with a temporary database.

Example
from django.test import TestCase

class PostTests(TestCase):
    def test_str(self):
        p = Post(title="Hi")
        self.assertEqual(str(p), "Hi")

# python manage.py test

Exercise

Run tests.

manage.py 

Quiz Test

What database do tests use?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.