def testSaveTemplate(self): from google.appengine.api import datastore_file_stub from google.appengine.api import mail_stub from google.appengine.api import user_service_stub from google.appengine.api import apiproxy_stub_map from google.appengine.api import urlfetch_stub apiproxy_stub_map.apiproxy = apiproxy_stub_map.APIProxyStubMap() apiproxy_stub_map.apiproxy.RegisterStub('urlfetch', urlfetch_stub.URLFetchServiceStub()) apiproxy_stub_map.apiproxy.RegisterStub('user', user_service_stub.UserServiceStub()) apiproxy_stub_map.apiproxy.RegisterStub('datastore_v3', datastore_file_stub.DatastoreFileStub('yaksha', None, None)) apiproxy_stub_map.apiproxy.RegisterStub('mail', mail_stub.MailServiceStub()) t = ProblemTemplate(modelProblemClassName="dummy", body="body") key = t.put() t1 = ProblemTemplate.get(key) self.assertEquals(t1.key(), t.key()) self.assertEquals(t1.problemName, t.problemName) self.assertEquals(t1.body, t.body) self.assertEquals(t1.author, t.author) self.assertEquals(t1.created, t.created) t.delete()