'Ensure new user has one PasswordHistory and no PasswordExpiry.'

def test_signup(self):

    email = 'foobar@example.com'
    password = 'bar'
    post_data = {'username': 'foo', 'password': password, 'password_confirm': password, 'email': email}
    response = self.client.post(reverse('account_signup'), post_data)
    self.assertEqual(response.status_code, 302)
    user = User.objects.get(email=email)
    self.assertFalse(hasattr(user, 'password_expiry'))
    latest_history = user.password_history.latest('timestamp')
    self.assertTrue(latest_history)
    self.assertFalse(check_password_expired(user))
    self.assertTrue(check_password(password, latest_history.password))
