File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 104
104
users = models.ManyToManyField(settings.AUTH_USER_MODEL)
105
105
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
106
106
unq_user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
107
+
108
+ - case : test_relate_to_auth_user_model_when_auth_not_installed
109
+ main : |
110
+ from other.models import Other
111
+ reveal_type(Other().user)
112
+ out : |
113
+ main:2: note: Revealed type is "myapp.models.MyUser"
114
+ custom_settings : |
115
+ INSTALLED_APPS = ('django.contrib.contenttypes', 'myapp', 'other')
116
+ AUTH_USER_MODEL='myapp.MyUser'
117
+ files :
118
+ - path : myapp/__init__.py
119
+ - path : myapp/models.py
120
+ content : |
121
+ from django.db import models
122
+
123
+ class MyUser(models.Model):
124
+ ...
125
+ - path : other/__init__.py
126
+ - path : other/models.py
127
+ content : |
128
+ from django.conf import settings
129
+ from django.db import models
130
+
131
+ class Other(models.Model):
132
+ user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
You can’t perform that action at this time.
0 commit comments