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)
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]