def test_pickle(self): """Test pickling and unpickling model instances """ s = pickle_object(qa) obj = unpickle_object(s, LDAP_CONN) self.assertEqual(obj.string, u"Max Blank") self.assertEqual(obj.dn, "cn=Max Blank,ou=users,dc=company,dc=com")
def pickle(self): """Returns list of pickled objects """ return [pickle_object(obj) for obj in self]