File: test_testcase.yml

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (13 lines) | stat: -rw-r--r-- 703 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
-   case: testcase_client_attr
    main: |
      from typing_extensions import reveal_type
      from django.test.testcases import TestCase

      class ExampleTestCase(TestCase):
          def test_method(self) -> None:
              reveal_type(self.client)  # N: Revealed type is "django.test.client.Client"
              resp = self.client.post('/url', {'doit': 'srs'}, 'application/json', False, True, extra='value')
              reveal_type(resp.status_code)   # N: Revealed type is "builtins.int"
              # Attributes monkey-patched by test Client class:
              resp.json()
              reveal_type(resp.wsgi_request)  # N: Revealed type is "django.core.handlers.wsgi.WSGIRequest"