@@ -18,32 +18,6 @@ def setUp(self):
18
18
'num_samples_collected shared '
19
19
'num_raw_data pi pmids owner status '
20
20
'abstract' )
21
- self .exp_studies = {
22
- self .StudyTuple (
23
- id = 1 ,
24
- title = 'Identification of the Microbiomes for Cannabis Soils' ,
25
- meta_complete = True , num_samples_collected = 27 ,
26
- shared = '<a target="_blank" href="mailto:shared@foo.bar">'
27
- 'Shared</a>' ,
28
- num_raw_data = 4 ,
29
- pi = '<a target="_blank" href="mailto:PI_dude@foo.bar">'
30
- 'PIDude</a>' ,
31
- pmids = '<a target="_blank" href="http://www.ncbi.nlm.nih.gov/'
32
- 'pubmed/123456">123456</a>, '
33
- '<a target="_blank" href="http://www.ncbi.nlm.nih.gov/'
34
- 'pubmed/7891011">7891011</a>' ,
35
- owner = '<a target="_blank" href="mailto:test@foo.bar">'
36
- 'test@foo.bar</a>' ,
37
- status = 'public' ,
38
- abstract = 'This is a preliminary study to examine the '
39
- 'microbiota associated with the Cannabis plant. Soils samples '
40
- 'from the bulk soil, soil associated with the roots, and the '
41
- 'rhizosphere were extracted and the DNA sequenced. Roots from '
42
- 'three independent plants of different strains were examined. '
43
- 'These roots were obtained November 11, 2011 from plants that '
44
- 'had been harvested in the summer. Future studies will '
45
- 'attempt to analyze the soils and rhizospheres from the same '
46
- 'location at different time points in the plant lifecycle.' )}
47
21
super (TestHelpers , self ).setUp ()
48
22
49
23
def test_get_shared_links_for_study (self ):
@@ -52,11 +26,39 @@ def test_get_shared_links_for_study(self):
52
26
self .assertEqual (obs , exp )
53
27
54
28
def test_build_study_info (self ):
29
+ self .maxDiff = None
55
30
Study (1 ).status = 'public'
56
31
obs = _build_study_info ('standard' , User ('test@foo.bar' ))
57
- self .assertItemsEqual (obs , self .exp_studies )
32
+ exp = {self .StudyTuple (
33
+ id = 1 ,
34
+ title = 'Identification of the Microbiomes for Cannabis Soils' ,
35
+ meta_complete = True , num_samples_collected = 27 ,
36
+ shared = '<a target="_blank" href="mailto:shared@foo.bar">'
37
+ 'Shared</a>' ,
38
+ num_raw_data = 4 ,
39
+ pi = '<a target="_blank" href="mailto:PI_dude@foo.bar">'
40
+ 'PIDude</a>' ,
41
+ pmids = '<a target="_blank" href="http://www.ncbi.nlm.nih.gov/'
42
+ 'pubmed/123456">123456</a>, '
43
+ '<a target="_blank" href="http://www.ncbi.nlm.nih.gov/'
44
+ 'pubmed/7891011">7891011</a>' ,
45
+ owner = '<a target="_blank" href="mailto:test@foo.bar">'
46
+ 'test@foo.bar</a>' ,
47
+ status = 'public' ,
48
+ abstract = 'This is a preliminary study to examine the '
49
+ 'microbiota associated with the Cannabis plant. Soils samples '
50
+ 'from the bulk soil, soil associated with the roots, and the '
51
+ 'rhizosphere were extracted and the DNA sequenced. Roots from '
52
+ 'three independent plants of different strains were examined. '
53
+ 'These roots were obtained November 11, 2011 from plants that '
54
+ 'had been harvested in the summer. Future studies will '
55
+ 'attempt to analyze the soils and rhizospheres from the same '
56
+ 'location at different time points in the plant lifecycle.' )}
57
+ self .assertItemsEqual (obs , exp )
58
58
59
59
def test_build_study_info_new_study (self ):
60
+ self .maxDiff = None
61
+ Study (1 ).status = 'public'
60
62
info = {
61
63
'timeseries_type_id' : 1 ,
62
64
'portal_type_id' : 1 ,
@@ -70,17 +72,41 @@ def test_build_study_info_new_study(self):
70
72
user = User ('test@foo.bar' )
71
73
72
74
Study .create (user , 'test_study_1' , efo = [1 ], info = info )
73
-
74
75
obs = _build_study_info ('standard' , user )
75
- self .exp_studies .add (
76
+ exp = {
77
+ self .StudyTuple (
78
+ id = 1 ,
79
+ title = 'Identification of the Microbiomes for Cannabis Soils' ,
80
+ meta_complete = True , num_samples_collected = 27 ,
81
+ shared = '<a target="_blank" href="mailto:shared@foo.bar">'
82
+ 'Shared</a>' ,
83
+ num_raw_data = 4 ,
84
+ pi = '<a target="_blank" href="mailto:PI_dude@foo.bar">'
85
+ 'PIDude</a>' ,
86
+ pmids = '<a target="_blank" href="http://www.ncbi.nlm.nih.gov/'
87
+ 'pubmed/7891011">7891011</a>, '
88
+ '<a target="_blank" href="http://www.ncbi.nlm.nih.gov/'
89
+ 'pubmed/123456">123456</a>' ,
90
+ owner = '<a target="_blank" href="mailto:test@foo.bar">'
91
+ 'test@foo.bar</a>' ,
92
+ status = 'public' ,
93
+ abstract = 'This is a preliminary study to examine the '
94
+ 'microbiota associated with the Cannabis plant. Soils samples '
95
+ 'from the bulk soil, soil associated with the roots, and the '
96
+ 'rhizosphere were extracted and the DNA sequenced. Roots from '
97
+ 'three independent plants of different strains were examined. '
98
+ 'These roots were obtained November 11, 2011 from plants that '
99
+ 'had been harvested in the summer. Future studies will '
100
+ 'attempt to analyze the soils and rhizospheres from the same '
101
+ 'location at different time points in the plant lifecycle.' ),
76
102
self .StudyTuple (
77
103
id = 2 , title = 'test_study_1' , meta_complete = False ,
78
104
num_samples_collected = None , shared = '' , num_raw_data = 0 ,
79
105
pi = '<a target="_blank" href="mailto:PI_dude@foo.bar">'
80
106
'PIDude</a>' , pmids = '' , owner = '<a target="_blank" '
81
107
'href="mailto:test@foo.bar">test@foo.bar</a>' ,
82
- status = 'sandbox' , abstract = 'abstract' ))
83
- self .assertItemsEqual (obs , self . exp_studies )
108
+ status = 'sandbox' , abstract = 'abstract' )}
109
+ self .assertItemsEqual (obs , exp )
84
110
85
111
86
112
class TestStudyEditorForm (TestHandlerBase ):
0 commit comments