예제 #1
0
파일: models.py 프로젝트: hudora/RobotRock
 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]