Created
February 20, 2020 14:17
-
-
Save tyndyll/7461c0032900934250607ff006c67c04 to your computer and use it in GitHub Desktop.
Test Django URL Resolves to Correct CBV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import TestCase | |
from django.urls import resolve | |
from .views import Home | |
class TestURLPatterns(TestCase): | |
def test_home_path_calls_home_view(self): | |
found = resolve("/") | |
self.assertEqual(found.func.view_class, Home) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment