Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
09e09f83
Commit
09e09f83
authored
5 years ago
by
anonymous
Browse files
Options
Downloads
Patches
Plain Diff
add integration test for new label
parent
e6878ad2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ckanext/odsh/tests/test_search.py
+15
-1
15 additions, 1 deletion
ckanext/odsh/tests/test_search.py
with
15 additions
and
1 deletion
ckanext/odsh/tests/test_search.py
+
15
−
1
View file @
09e09f83
...
@@ -9,6 +9,7 @@ from nose.tools import assert_true, assert_false, assert_equal, assert_in
...
@@ -9,6 +9,7 @@ from nose.tools import assert_true, assert_false, assert_equal, assert_in
from
routes
import
url_for
from
routes
import
url_for
import
ckan.plugins
import
ckan.plugins
from
test_helpers
import
odsh_test
from
test_helpers
import
odsh_test
import
pdb
...
@@ -183,6 +184,17 @@ class TestSearch(helpers.FunctionalTestBase):
...
@@ -183,6 +184,17 @@ class TestSearch(helpers.FunctionalTestBase):
self
.
_assert_datasets_in_response
([
datasetA
],
response5
)
self
.
_assert_datasets_in_response
([
datasetA
],
response5
)
self
.
_assert_datasets_not_in_response
([
datasetA
],
response6
)
self
.
_assert_datasets_not_in_response
([
datasetA
],
response6
)
@odsh_test
()
def
test_dataset_new_has_label
(
self
):
# arrange
datasetA
=
self
.
_create_dataset
(
'
dataseta
'
,
'
1960-01-01
'
,
None
,
'
mytitle
'
)
# act
response
=
self
.
_perform_text_and_date_search
(
'
mytitle
'
,
None
,
None
)
# assert
response
.
mustcontain
(
'
new-dataset-label
'
)
def
_assert_datasets_in_response
(
self
,
datasets
,
response
):
def
_assert_datasets_in_response
(
self
,
datasets
,
response
):
for
dataset
in
datasets
:
for
dataset
in
datasets
:
assert
dataset
[
'
name
'
]
in
response
assert
dataset
[
'
name
'
]
in
response
...
@@ -200,6 +212,8 @@ class TestSearch(helpers.FunctionalTestBase):
...
@@ -200,6 +212,8 @@ class TestSearch(helpers.FunctionalTestBase):
{
'
key
'
:
'
temporal_start
'
,
'
value
'
:
temporal_start
},
{
'
key
'
:
'
temporal_start
'
,
'
value
'
:
temporal_start
},
{
'
key
'
:
'
temporal_end
'
,
'
value
'
:
temporal_end
},
{
'
key
'
:
'
temporal_end
'
,
'
value
'
:
temporal_end
},
{
'
key
'
:
'
issued
'
,
'
value
'
:
'
2000-01-27
'
},
{
'
key
'
:
'
issued
'
,
'
value
'
:
'
2000-01-27
'
},
{
'
key
'
:
'
groups
'
,
'
value
'
:
'
soci
'
},
{
'
key
'
:
'
licenseAttributionByText
'
,
'
value
'
:
'
text
'
},
{
'
key
'
:
'
spatial_uri
'
,
'
value
'
:
'
http://dcat-ap.de/def/politicalGeocoding/districtKey/01001
'
}
{
'
key
'
:
'
spatial_uri
'
,
'
value
'
:
'
http://dcat-ap.de/def/politicalGeocoding/districtKey/01001
'
}
]
]
return
factories
.
Dataset
(
user
=
user
,
return
factories
.
Dataset
(
user
=
user
,
...
@@ -207,7 +221,7 @@ class TestSearch(helpers.FunctionalTestBase):
...
@@ -207,7 +221,7 @@ class TestSearch(helpers.FunctionalTestBase):
title
=
title
,
title
=
title
,
issued
=
'
27-01-2000
'
,
issued
=
'
27-01-2000
'
,
extras
=
extras
,
extras
=
extras
,
license_id
=
'
id
'
)
license_id
=
'
http://dcat-ap.de/def/licenses/dl-by-de/2.0
'
)
def
_perform_search
(
self
,
query
=
None
):
def
_perform_search
(
self
,
query
=
None
):
search_form
=
self
.
_perform_search_for_form
(
'
dataset-search-box-form
'
)
search_form
=
self
.
_perform_search_for_form
(
'
dataset-search-box-form
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment