mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-21 03:11:17 +08:00
request.user has type of AUTH_USER_MODEL
This commit is contained in:
16
test-data/typecheck/test_request.yml
Normal file
16
test-data/typecheck/test_request.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
- case: request_object_has_user_of_type_auth_user_model
|
||||
disable_cache: true
|
||||
main: |
|
||||
from django.http.request import HttpRequest
|
||||
reveal_type(HttpRequest().user) # N: Revealed type is 'myapp.models.MyUser'
|
||||
installed_apps:
|
||||
- myapp
|
||||
additional_settings:
|
||||
- AUTH_USER_MODEL='myapp.MyUser'
|
||||
files:
|
||||
- path: myapp/__init__.py
|
||||
- path: myapp/models.py
|
||||
content: |
|
||||
from django.db import models
|
||||
class MyUser(models.Model):
|
||||
pass
|
||||
Reference in New Issue
Block a user