Esempio n. 1
0
 def testDaoSaveService(self):
     data={'name':'web develop','description':'this service is to create web'}
     DAO().saveService(data)
     q = Service.query()
     services=q.fetch()
     self.assertEqual(1, len(services))
     self.assertEqual('web develop', services[0].name)
Esempio n. 2
0
 def createCompanyServices(self, num=10):
     txt = """
     this text for description for the service.
     """
     for i in range(0, num):
         """
         if i%2 == 0:
             websites = []
         elif i%3 == 0:
             websites = ['web'+str(i),'web'+str(i+1)]
         else:
             websites = ['web'+str(i)]
         """
         service = Service(name="Service " + str(i), description=txt)
         # project.name='Project '+str(i)
         # project.created=datetime.datetime.now()
         service.put()
Esempio n. 3
0
 def testCreateServices(self):
     DbManager().createCompanyServices()
     services = Service.query().fetch(10)
     self.assertEqual(10, len(services))
     # test the description:
     txt1=services[0].description
     txt2='''
     this text for description for the service.
     '''
     self.assertEqual(txt1, txt2)
Esempio n. 4
0
 def addService(self, boisson, quantite):
     cuve = self.getCuveFromBoisson(boisson)
     new = Service(boisson, cuve, quantite)
     self.services.append(new)
Esempio n. 5
0
 def getServices(self):
     q = Service.query()
     services, nextCursor, more = q.fetch_page(20)
     return services
Esempio n. 6
0
 def saveService(self, data):
     service = Service(name=data['name'],
             description=data['description'])
     service.put()
Esempio n. 7
0
 def saveService(self, data):
     ''' for services offered by company '''
     service = Service(name=data['name'],
             description=data['description'])
     service.put()