entities/test/unittest_base.py
changeset 10411 4ee15441f2eb
parent 10251 2daa5c6dea4d
parent 10402 e3c20f4d1a7c
child 10662 10942ed172de
equal deleted inserted replaced
10410:eb681a030699 10411:4ee15441f2eb
   135             self.assertEqual(e.name(), u'bouah')
   135             self.assertEqual(e.name(), u'bouah')
   136             e.cw_set(surname=u'lôt')
   136             e.cw_set(surname=u'lôt')
   137             self.assertEqual(e.dc_title(), 'member')
   137             self.assertEqual(e.dc_title(), 'member')
   138             self.assertEqual(e.name(), u'bouah lôt')
   138             self.assertEqual(e.name(), u'bouah lôt')
   139 
   139 
       
   140     def test_falsey_dc_title(self):
       
   141         with self.admin_access.repo_cnx() as cnx:
       
   142             e = cnx.create_entity('Company', order=0, name=u'pythonian')
       
   143             cnx.commit()
       
   144             self.assertEqual(u'0', e.dc_title())
       
   145 
   140     def test_allowed_massmail_keys(self):
   146     def test_allowed_massmail_keys(self):
   141         with self.admin_access.repo_cnx() as cnx:
   147         with self.admin_access.repo_cnx() as cnx:
   142             e = cnx.execute('CWUser U WHERE U login "member"').get_entity(0, 0)
   148             e = cnx.execute('CWUser U WHERE U login "member"').get_entity(0, 0)
   143             # Bytes/Password attributes should be omited
   149             # Bytes/Password attributes should be omitted
   144             self.assertEqual(e.cw_adapt_to('IEmailable').allowed_massmail_keys(),
   150             self.assertEqual(e.cw_adapt_to('IEmailable').allowed_massmail_keys(),
   145                               set(('surname', 'firstname', 'login', 'last_login_time',
   151                               set(('surname', 'firstname', 'login', 'last_login_time',
   146                                    'creation_date', 'modification_date', 'cwuri', 'eid'))
   152                                    'creation_date', 'modification_date', 'cwuri', 'eid'))
   147                               )
   153                               )
   148 
   154