-
Couldn't load subscription status.
- Fork 79
Propagate artifact visibility #1578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,15 @@ | |
|
|
||
| from qiita_pet.test.tornado_test_base import TestHandlerBase | ||
| from qiita_core.exceptions import IncompetentQiitaDeveloperError | ||
| from qiita_db.artifact import Artifact | ||
| from qiita_db.study import StudyPerson, Study | ||
| from qiita_db.util import get_count, check_count | ||
| from qiita_db.user import User | ||
| from qiita_pet.handlers.study_handlers.listing_handlers import ( | ||
| _get_shared_links_for_study, _build_study_info, _build_single_study_info, | ||
| _build_single_proc_data_info) | ||
| from qiita_pet.handlers.study_handlers.description_handlers import ( | ||
| _propagate_visibility) | ||
|
|
||
|
|
||
| class TestHelpers(TestHandlerBase): | ||
|
|
@@ -156,6 +159,27 @@ def test_build_study_info_new_study(self): | |
| 'proc_data_info': []}) | ||
| self.assertEqual(obs, self.exp) | ||
|
|
||
| def test_propagate_visibility(self): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a test for those that are not BIOM? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| a = Artifact(4) | ||
| a.visibility = 'public' | ||
| _propagate_visibility(a) | ||
| self.assertEqual(Artifact(1).visibility, 'public') | ||
| self.assertEqual(Artifact(2).visibility, 'public') | ||
| self.assertEqual(Artifact(4).visibility, 'public') | ||
|
|
||
| a.visibility = 'private' | ||
| _propagate_visibility(a) | ||
| self.assertEqual(Artifact(1).visibility, 'private') | ||
| self.assertEqual(Artifact(2).visibility, 'private') | ||
| self.assertEqual(Artifact(4).visibility, 'private') | ||
|
|
||
| a = Artifact(2) | ||
| a.visibility = 'public' | ||
| _propagate_visibility(a) | ||
| self.assertEqual(Artifact(1).visibility, 'private') | ||
| self.assertEqual(Artifact(2).visibility, 'private') | ||
| self.assertEqual(Artifact(4).visibility, 'private') | ||
|
|
||
|
|
||
| class TestStudyEditorForm(TestHandlerBase): | ||
| # TODO: add proper test for this once figure out how. Issue 567 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"of artifact" -> "of an artifact"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done