'Verifies whether the user object exists.'

def _verify_user_existence(self, user_exists, social_link_exists, user_is_active=None, username=None):

    users = User.objects.filter(username=(username if username else 'test_username'))
    self.assertEquals(users.exists(), user_exists)
    if user_exists:
        self.assertEquals(users[0].is_active, user_is_active)
        self.assertEqual(UserSocialAuth.objects.filter(user=users[0], provider=self.BACKEND).exists(), social_link_exists)
    else:
        self.assertEquals(UserSocialAuth.objects.count(), 0)
