-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
150 additions
and
296 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
# Create your tests here. | ||
from django.test import TestCase, Client | ||
from django.urls import reverse | ||
from .models import Page | ||
|
||
class PageViewTest(TestCase): | ||
def setUp(self): | ||
self.client = Client() | ||
self.page = Page.objects.create(title='Test Page', content='Test Content') | ||
|
||
def test_view_page(self): | ||
url = reverse('pages:view', args=[self.page.slug]) | ||
response = self.client.get(url) | ||
self.assertEqual(response.status_code, 200) | ||
self.assertContains(response, 'Test Content') |
Oops, something went wrong.