コード例 #1
0
ファイル: tests.py プロジェクト: MechanisM/django-signalqueue
 def test_admin_queue_status_widget_contains_queue_names(self):
     from signalqueue.worker import queues
     post_out = self.client.post('/admin/', dict(
         username=self.user.username, password=self.testpass, this_is_the_login_form='1', next='/admin/'))
     admin_root_page = self.client.get('/admin/')
     for queue_name in queues.keys():
         self.assertContains(admin_root_page, queue_name.capitalize())
         self.assertTrue(queue_name.capitalize() in admin_root_page.content)
     self.client.get('/admin/logout/')
コード例 #2
0
 def test_worker_status_url_with_queue_parameter_content(self):
     from signalqueue.worker import queues
     for queue_name in queues.keys():
         #if queue_name is not 'celery':
         cnt = queues[queue_name].count() or 0
         self.http_client.fetch(
             self.get_url('/status?queue=%s' % queue_name), self.stop)
         response = self.wait()
         self.assertTrue(queue_name in response.body)
         self.assertTrue("enqueued" in response.body)
コード例 #3
0
ファイル: tests.py プロジェクト: MechanisM/django-signalqueue
 def test_worker_status_url_with_queue_parameter_content(self):
     from signalqueue.worker import queues
     for queue_name in queues.keys():
         self.http_client.fetch(self.get_url('/status?queue=%s' % queue_name), self.stop)
         response = self.wait()
         self.assertTrue(queue_name in response.body)
         self.assertTrue("enqueued" in response.body)
         
         phrase = "%s enqueued signals" % queues[queue_name].count()
         self.assertTrue(phrase in response.body)
コード例 #4
0
ファイル: vortex.py プロジェクト: twidi/django-signalqueue
 def queue(self, queue_name=None):
     if queue_name is None:
         queue_name = self.application.queue_name
     if queue_name not in queues.keys():
         raise IndexError("No queue named %s is defined" % queue_name)
     
     if not queue_name in self.application.queues:
         self.application.queues[queue_name] = PoolQueue(queue_name=queue_name, active=False)
     
     return self.application.queues[queue_name]
コード例 #5
0
    def queue(self, queue_name=None):
        if queue_name is None:
            queue_name = self.application.queue_name
        if queue_name not in queues.keys():
            raise IndexError("No queue named %s is defined" % queue_name)

        if not queue_name in self.application.queues:
            self.application.queues[queue_name] = PoolQueue(
                queue_name=queue_name, active=False)

        return self.application.queues[queue_name]
コード例 #6
0
    def test_admin_queue_status_widget_contains_queue_names(self):
        from signalqueue.worker import queues

        post_out = self.client.post(
            "/admin/",
            dict(username=self.user.username, password=self.testpass, this_is_the_login_form="1", next="/admin/"),
        )
        admin_root_page = self.client.get("/admin/")
        for queue_name in queues.keys():
            self.assertContains(admin_root_page, queue_name.capitalize())
            self.assertTrue(queue_name.capitalize() in admin_root_page.content)
        self.client.get("/admin/logout/")
        print post_out  # pyflakes don't crack
コード例 #7
0
 def test_admin_queue_status_widget_contains_queue_names(self):
     from signalqueue.worker import queues
     post_out = self.client.post(
         '/admin/',
         dict(username=self.user.username,
              password=self.testpass,
              this_is_the_login_form='1',
              next='/admin/'))
     admin_root_page = self.client.get('/admin/')
     for queue_name in queues.keys():
         self.assertContains(admin_root_page, queue_name.capitalize())
         self.assertTrue(queue_name.capitalize() in admin_root_page.content)
     self.client.get('/admin/logout/')
     print post_out  # pyflakes don't crack