Пример #1
0
 def testInsertQTask(self):
     u = QUser(g_user=users.User("*****@*****.**"), t_name="mryoshio")
     u.put()
     task = QTask(creator=u, assignee=u, title="test_title", description="test_description", deadline=datetime.datetime.today() + datetime.timedelta(3), done=False)
     task.put()
     hit = task.gql("WHERE assignee = :1", u)
     self.assertEqual(u"*****@*****.**", hit.get().creator.g_user.email())
     self.assertEqual(u"*****@*****.**", hit.get().assignee.g_user.email())
     self.assertEqual(u"test_title", hit.get().title)
     self.assertEqual(u"test_description", hit.get().description)
     self.assertFalse(hit.get().done)
Пример #2
0
 def testReminder_002(self):
     deadline = datetime.datetime.today() + datetime.timedelta(hours=6)
     u = QUser(g_user=users.User(email='*****@*****.**'))
     u.put()
     title = 'chips and beer'
     t = QTask(creator=u, assignee=u, title=title, description='', deadline=deadline, done=True)
     t.put()
     r = Reminder()
     r.get()
     messages = self.mail_stub.get_sent_messages(to='*****@*****.**')
     self.assertEqual(0, len(messages))
Пример #3
0
 def post(self):
     if self.request.get("deadline") == None or self.request.get("deadline") == "":
         # default deadline = now + 1week
         deadline = datetime.datetime.today() + datetime.timedelta(7)
     else:
         # TODO modify to process input
         deadline = datetime.datetime.today() + datetime.timedelta(3)
     t = QTask(
         creator=self.get_current_quser(),
         assignee=self.get_current_quser(),
         title=self.request.get("title"),
         description=self.request.get("description"),
         deadline=deadline,
         done=False,
     )
     t.put()
     self.redirect("/")
Пример #4
0
 def post(self):
     key = self.request.get("key")
     if key == None or key == "":
         pass
     else:
         qtask = QTask.get(key)
         logging.debug(qtask)
         qtask.delete()
     self.redirect("/")
Пример #5
0
 def post(self):
     key = self.request.get("key")
     sta = self.request.get("status")
     if key == None or key == "":
         pass
     else:
         qtask = QTask.get(key)
         qtask.done = ast.literal_eval(sta)
         qtask.put()