code: def assert_valid(self):
          
          assert self.trntype in TRANSACTION_TYPES, \
              "trntype must be one of %s" % TRANSACTION_TYPES
  
          if self.bank_account_to:
              self.bank_account_to.assert_valid()
docs: Ensure that fields have valid values