コード例 #1
0
 def test_from_dict(self):
     account = Account._from_dict(
         {'id': None,
          'book': self.book._id,
          'org': self.org._id,
          'version': self.account._version,
          'type': self.account._type,
          'normal_balance': self.account.normal_balance,
          'description': '1210 Accounts Receivable'})
     # Attribute values
     self.assertEqual(account.description, '1210 Accounts Receivable')
     self.assertEqual(account.reference, None)
     # Identity
     self.assertIsNot(account, self.account)
コード例 #2
0
 def test_from_dict_index(self):
     data = {'id': self.account._id, 'book': self.book._id}
     logging.info(data)
     retrieved = Account._from_dict(data)
     # Identity
     self.assertIs(retrieved, self.account)