def test_when_all_incorrect(self): test_example = DebtViewModel(req_sum='@@', percent_rate=-55, period=44, year=-000) self.assertTrue('Error: Incorrect input', test_example.get_error_message())
def test_when_period_incorrect(self): test_example = DebtViewModel(req_sum=200000, percent_rate=0.14, period=4, year=4) test_example.set_period(-5) self.assertTrue('Error: Incorrect input', test_example.get_error_message())
def test_by_default_error_is_true(self): test_example = DebtViewModel() self.assertEqual('Please enter data', test_example.get_error_message())
def test_when_enter_data(self): test_example = DebtViewModel(req_sum=200000, percent_rate=0.14, period=4, year=4) self.assertTrue('Normal work', test_example.get_error_message())