Changeset View
Changeset View
Standalone View
Standalone View
blog/tests/test_blog_posts.py
| Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | def test_updating_post(self): | ||||
| 'category': post.category, | 'category': post.category, | ||||
| 'content': 'Updated content with *markdown*', | 'content': 'Updated content with *markdown*', | ||||
| } | } | ||||
| response = self.client.post(post_change_url, change_data, follow=True) | response = self.client.post(post_change_url, change_data, follow=True) | ||||
| self.assertEqual(response.status_code, 200) | self.assertEqual(response.status_code, 200) | ||||
| self.assertEqual(Post.objects.count(), initial_post_count) | self.assertEqual(Post.objects.count(), initial_post_count) | ||||
| def test_blog_author_cannot_be_deleted(self): | |||||
| post = PostFactory() | |||||
| self.assertFalse(post.author.is_staff) | |||||
| self.assertFalse(post.author.is_superuser) | |||||
| self.assertFalse(post.author.can_be_deleted) | |||||
| class TestPostComments(TestCase): | class TestPostComments(TestCase): | ||||
| def setUp(self): | def setUp(self): | ||||
| self.user_without_subscription = UserFactory() | self.user_without_subscription = UserFactory() | ||||
| self.user = UserFactory() | self.user = UserFactory() | ||||
| self.other_user = UserFactory() | self.other_user = UserFactory() | ||||
| self.post = PostFactory() | self.post = PostFactory() | ||||
| ▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines | |||||