'Helper method to generate either an Admin or a User'

def _user_factory_with_history(self, is_staff=False, set_initial_history=True):

    if is_staff:
        user = AdminFactory()
    else:
        user = UserFactory()
    user.date_joined = timezone.now()
    if set_initial_history:
        history = PasswordHistory()
        history.create(user)
    return user
