Skip to content

Commit 4b2515a

Browse files
committed
Add test for WSGIRequest.context. Closes #78
The test can't reproduce the original problem reported in the issue so consider it resolved.
1 parent 70bc54b commit 4b2515a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""
2+
Checks that Pylint does not complain about a standard test. See:
3+
https://github.com/PyCQA/pylint-django/issues/78
4+
"""
5+
6+
from django.test import TestCase
7+
from django.db import models
8+
9+
10+
class SomeModel(models.Model):
11+
"""Just a model."""
12+
pass
13+
14+
15+
class SomeTestCase(TestCase):
16+
"""A test cast."""
17+
def test_thing(self):
18+
"""Test a thing."""
19+
expected_object = SomeModel()
20+
response = self.client.get('/get/some/thing/')
21+
self.assertEqual(response.status_code, 200)
22+
self.assertEqual(response.context['object'], expected_object)

0 commit comments

Comments
 (0)