コード例 #1
0
 def test_customer_forgot_password(self):
     R = self.post('/crm/customer_forgot_password',
                   {'username': TEST_CUSTOMER_EMAIL})
     assert R.status_int == 200
     assert "Your new password has been sent" in R.body
     custs = Customer.find_all_by_email(TEST_CUSTOMER_EMAIL)
     assert len(custs) > 0
     cust = custs[0]
     assert cust.password != TEST_CUSTOMER_PASSWORD
     cust.password = TEST_CUSTOMER_PASSWORD
     cust.save()
     self.commit()
コード例 #2
0
 def get_customer(self, username=TEST_CUSTOMER_EMAIL):
     custs = Customer.find_all_by_email(username)
     assert custs is not None and len(custs) > 0
     return custs[0]