File: test_state.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 (15 lines) | stat: -rw-r--r-- 527 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-   case: state_attribute_has_a_type_of_model_state
    main: |
        from typing_extensions import reveal_type
        from myapp.models import MyUser
        user = MyUser(pk=1)
        reveal_type(user._state)  # N: Revealed type is "django.db.models.base.ModelState"
    installed_apps:
        - myapp
    files:
        -   path: myapp/__init__.py
        -   path: myapp/models.py
            content: |
                from django.db import models
                class MyUser(models.Model):
                    pass