示例#1
0
 def change_status(self, status):
     """Statuswechsel"""
     
     from robotrock.notification import notify
     
     if status != self.status:
         self.status = status
         self.save()
         
         # Notify
         # set args, kwargs
         notify(self)
示例#2
0
文件: tests.py 项目: hudora/RobotRock
 def test_create(self):
     """E-Mailbenachrichtigung testen"""
     
     notification = {'status': 'shipped',
                     'recipient': '*****@*****.**',
                     'customer': '12345',
                     'means': 'email'}
     response = self.client.post('/robotrock/api/notifications/', notification, HTTP_AUTHORIZATION=build_authheader('api'))
     self.assertEqual(response.status_code, 201)
     
     order = Order.objects.get(pk=5)
     notify(order)
     self.assertEqual(len(self.notification_bucket.messages), 1)
     message = self.notification_bucket.messages[0]