def test_should_update_address(self): quote_request = QuoteRequest(self.quote) url = url_for('quote.edit', id=self.quote.id) quote_data = dict( address="New Address" ) with self.request_context(url, quote_data): quote_request.update_address() self.assertEqual(self.quote.address, "New Address")
def test_should_not_save_changes(self): quote_request = QuoteRequest(self.quote) url = url_for('quote.edit', id=self.quote.id) quote_data = dict( address="New Address" ) with self.request_context(url, quote_data): quote_request.update_address() self.db.session.rollback() self.assertNotEqual(self.quote.address, "New Address")
def test_should_set_address_to_customer_address_given_no_address_has_been_set(self): quote_request = QuoteRequest(self.quote) quote_request.update_address() self.assertEqual(self.quote.address, self.customer.address)