@@ -51,8 +51,8 @@ def test_new_journals_has_submission_configuration(self):
51
51
if not self .journal_one .submissionconfiguration :
52
52
self .fail ('Journal does not have a submissionconfiguration object.' )
53
53
54
- @staticmethod
55
- def create_journal ():
54
+ @classmethod
55
+ def create_journal (cls ):
56
56
"""
57
57
Creates a dummy journal for testing
58
58
:return: a journal
@@ -95,32 +95,31 @@ def create_authors(cls):
95
95
96
96
return author_1 , author_2
97
97
98
- def create_sections (self ):
99
- self .section_1 = models .Section .objects .create (
98
+ @classmethod
99
+ def create_sections (cls ):
100
+ cls .section_1 = models .Section .objects .create (
100
101
name = 'Test Public Section' ,
101
- journal = self .journal_one ,
102
+ journal = cls .journal_one ,
102
103
)
103
- self .section_2 = models .Section .objects .create (
104
+ cls .section_2 = models .Section .objects .create (
104
105
name = 'Test Private Section' ,
105
106
public_submissions = False ,
106
- journal = self .journal_one
107
+ journal = cls .journal_one
107
108
)
108
- self .section_3 = models .Section .objects .create (
109
- journal = self .journal_one ,
109
+ cls .section_3 = models .Section .objects .create (
110
+ journal = cls .journal_one ,
110
111
)
111
112
112
113
@classmethod
113
114
def setUpTestData (cls ):
114
- cls .journal_one = cls .create_journal ()
115
-
116
- def setUp (self ):
117
115
"""
118
116
Setup the test environment.
119
117
:return: None
120
118
"""
121
- self .editor = helpers .create_editor (self .journal_one )
122
- self .press = helpers .create_press ()
123
- self .create_sections ()
119
+ cls .journal_one = cls .create_journal ()
120
+ cls .editor = helpers .create_editor (cls .journal_one )
121
+ cls .press = helpers .create_press ()
122
+ cls .create_sections ()
124
123
125
124
def test_article_image_galley (self ):
126
125
article = models .Article .objects .create (
@@ -280,9 +279,9 @@ def test_snapshot_author_metadata_override(self):
280
279
281
280
article .snapshot_authors ()
282
281
new_department = "New department"
283
- for frozen in article .frozen_authors ():
284
- frozen .department = new_department
285
- frozen .save ()
282
+ for frozen_author in article .frozen_authors ():
283
+ frozen_author .department = new_department
284
+ frozen_author .save ()
286
285
article .snapshot_authors (force_update = True )
287
286
frozen = article .frozen_authors ().all ()[0 ]
288
287
@@ -789,8 +788,7 @@ def create_journal():
789
788
790
789
return journal_one
791
790
792
- @classmethod
793
- def create_authors (cls ):
791
+ def create_authors (self ):
794
792
author_1_data = {
795
793
796
794
'is_active' : True ,
@@ -813,20 +811,17 @@ def create_authors(cls):
813
811
'department' : 'English & Humanities' ,
814
812
'institution' : 'Birkbeck, University of London' ,
815
813
}
816
- author_1 = helpers .create_author (cls .journal_one , ** author_1_data )
817
- author_2 = helpers .create_author (cls .journal_one , ** author_2_data )
814
+ author_1 = helpers .create_author (self .journal_one , ** author_1_data )
815
+ author_2 = helpers .create_author (self .journal_one , ** author_2_data )
818
816
819
817
return author_1 , author_2
820
818
821
- @classmethod
822
- def setUpTestData (cls ):
823
- cls .journal_one = cls .create_journal ()
824
-
825
819
def setUp (self ):
826
820
"""
827
821
Setup the test environment.
828
822
:return: None
829
823
"""
824
+ self .journal_one = self .create_journal ()
830
825
self .editor = helpers .create_editor (self .journal_one )
831
826
self .press = helpers .create_press ()
832
827
0 commit comments