title: Django how to properly test User instance
body: <p>A few days ago I found a really nice webpage with Patterns and Anti-Patterns in Django. One of the anti-patterns is connected with linking custom user model to other models.</p>
  <p>Basic on <a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.get_user_model" rel="nofollow noreferrer">Django documentation</a> and <a href="https://www.django-antipatterns.com/antipattern/refer-to-the-user-model-directly.html" rel="nofollow noreferrer">this</a> webpage I would like to know:</p>
  <ol>
  <li><p>What are the limitations between calling <code>get_user_model()</code> and <code>settings.AUTH_USER_MODEL</code>? What kind of differences are between those two approaches?</p>
  </li>
  <li><p>How to prepare mock user in tests? Should I create user instance from <code>AUTH_USER_MODEL</code> or <code>get_user_model</code>?</p>
  <pre><code>from django.contrib.auth import get_user_model
  
  User = get_user_model() # or settings.AUTH_USER_MODEL 
  
  self.custom_user = User.objects.create(
      username='test',
      password='password',
      first_name='test name',
      email='test@test.test',
  )
  
  
  </code></pre>
  </li>
  </ol>