title: A better way to import AUTH_USER_MODEL in Django 1.5
body: <p>I'm trying to make plugable apps more resilient under Django 1.5 where you now have a custom definable user model.</p>
  
  <p>When adding foreign keys to a model I can do:</p>
  
  <pre><code>user = models.ForeignKey(settings.AUTH_USER_MODEL)
  </code></pre>
  
  <p>which saves me the import of User at the top of the file that breaks when <code>django.contrib.auth.models.User</code> is no longer the user model.  But sometimes when testing, I need to be able to create a user, and the best I've been able to come up with for this is</p>
  
  <pre><code>from django.conf import settings
  from django.db.models import get_model
  User = get_model(*settings.AUTH_USER_MODEL.split('.'))
  </code></pre>
  
  <p>then I can do things like:</p>
  
  <pre><code>User.objects.create(username="test")
  </code></pre>
  
  <p>within my test (some objects have FK's tied to users and I need one of those objects in a test).</p>
  
  <p>It doesn't strike me as particularly elegant, but I really don't see any cleaner way to do this in 1.5.</p>
  
  <p>Did I miss something in the docs?</p>