Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2003] smaller, simpler, new_test for package_patch
- Loading branch information
Showing
2 changed files
with
32 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'''Unit tests for ckan/logic/action/update.py.''' | ||
import datetime | ||
|
||
from nose.tools import assert_equals, assert_raises | ||
import mock | ||
import pylons.config as config | ||
|
||
#import ckan.logic as logic | ||
from ckan.new_tests import helpers | ||
#import ckan.new_tests.factories as factories | ||
|
||
class TestPatch(helpers.FunctionalTestBase): | ||
|
||
def test_package_patch_updating_single_field(self): | ||
user = factories.User() | ||
dataset = factories.Dataset( | ||
name='annakarenina', | ||
notes='some test now', | ||
user=user) | ||
|
||
dataset = helpers.call_action( | ||
'package_patch', | ||
id=dataset['id'], | ||
name='somethingnew', | ||
) | ||
|
||
assert_equals(dataset['name'], 'somethingnew') | ||
assert_equals(dataset['notes'], 'some test now') | ||
|
||
assert_equals( | ||
helpers.call_action('package_show', id='somethingnew')['notes'], | ||
'some test now') |
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