'A superuser can be created when a custom User model is in use'

@override_settings(AUTH_USER_MODEL=u'auth.CustomUser')
def test_swappable_user(self):

    new_io = StringIO()
    call_command(u'createsuperuser', interactive=False, email=u'joe@somewhere.org', date_of_birth=u'1976-04-01', stdout=new_io, skip_validation=True)
    command_output = new_io.getvalue().strip()
    self.assertEqual(command_output, u'Superuser    created    successfully.')
    u = CustomUser._default_manager.get(email=u'joe@somewhere.org')
    self.assertEqual(u.date_of_birth, date(1976, 4, 1))
    self.assertFalse(u.has_usable_password())
