| 6 | |
| 7 | |
| 8 | class BlogPostTests(BaseTestCase): |
| 9 | |
| 10 | # Ensure a logged in user can add a new post |
| 11 | def test_user_can_post(self): |
| 12 | with self.client: |
| 13 | self.client.post( |
| 14 | '/login', |
| 15 | data=dict(username="admin", password="admin"), |
| 16 | follow_redirects=True |
| 17 | ) |
| 18 | response = self.client.post( |
| 19 | '/', |
| 20 | data=dict(title="test", description="test"), |
| 21 | follow_redirects=True |
| 22 | ) |
| 23 | self.assertEqual(response.status_code, 200) |
| 24 | self.assertIn(b'New entry was successfully posted. Thanks.', |
| 25 | response.data) |
| 26 | |
| 27 | |
| 28 | if __name__ == '__main__': |
nothing calls this directly
no outgoing calls
no test coverage detected