def test_add(self): client = self.create_client() user = self.create_user() client.salary = 20 ClientSalaryHistory.add(self.store, 10, client, user) salary_histories = self.store.find(ClientSalaryHistory) last_salary_history = salary_histories.order_by(ClientSalaryHistory.id).last() self.assertEquals(last_salary_history.client, client) self.assertEquals(last_salary_history.new_salary, 20)
def test_add(self): client = self.create_client() user = self.create_user() client.salary = 20 ClientSalaryHistory.add(self.store, 10, client, user) salary_histories = self.store.find(ClientSalaryHistory) last_salary_history = salary_histories.order_by( ClientSalaryHistory.id).last() self.assertEquals(last_salary_history.client, client) self.assertEquals(last_salary_history.new_salary, 20)
def on_confirm(self): if self.model.salary != self._original_salary: ClientSalaryHistory.add(self.store, self._original_salary, self.model, api.get_current_user(self.store))