-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make using Celery optional; default to not using Celery (#10)
- Loading branch information
Showing
5 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from __future__ import absolute_import, division, print_function, unicode_literals | ||
|
||
from django.test import TestCase | ||
from mock import mock | ||
|
||
from quade import managers | ||
from quade.models import Record | ||
from quade.tasks import execute_test_task | ||
|
||
from . import factories | ||
from .mock import QuadeMock | ||
|
||
|
||
class TestExecuteTask(TestCase): | ||
|
||
def test_execute_unit(self): | ||
record = factories.Record() | ||
with mock.patch('quade.models.Record.execute_test') as mock_execute: | ||
execute_test_task(record.id) | ||
mock_execute.assert_called_once() | ||
|
||
@QuadeMock(managers) | ||
def test_execute_functional(self): | ||
record = factories.Record(scenario__config=[('customer', {})]) | ||
execute_test_task(record.id) | ||
record.refresh_from_db() | ||
self.assertEqual(record.status, Record.Status.READY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters