forked from ckan/ckanext-archiver
-
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.
Test for previous ResourceGroup change.
- Loading branch information
David Read
committed
Nov 10, 2015
1 parent
4797f2f
commit ed6bafb
Showing
1 changed file
with
24 additions
and
0 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,24 @@ | ||
import ckanext.archiver.model as archiver_model | ||
try: | ||
from ckan.tests.helpers import reset_db | ||
from ckan.tests import factories as ckan_factories | ||
except ImportError: | ||
from ckan.new_tests.helpers import reset_db | ||
from ckan.new_tests import factories as ckan_factories | ||
from ckan import model | ||
|
||
Archival = archiver_model.Archival | ||
|
||
|
||
class TestArchival(object): | ||
@classmethod | ||
def setup_class(cls): | ||
reset_db() | ||
archiver_model.init_tables(model.meta.engine) | ||
|
||
def test_create(self): | ||
dataset = ckan_factories.Dataset() | ||
res = ckan_factories.Resource(package_id=dataset['id']) | ||
archival = Archival.create(res['id']) | ||
assert isinstance(archival, Archival) | ||
assert archival.package_id == dataset['id'] |