Coverage for portality/crosswalks/jct_inprogress.py: 22%

18 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2022-07-19 17:05 +0100

1from portality.models import JournalLikeBibJSON 

2 

3class JCTInProgressXWalk(object): 

4 """ 

5 ~~JCT:Crosswalk->JCT:Feature~~ 

6 ~~->Application:Model~~ 

7 """ 

8 

9 @classmethod 

10 def application2jct(cls, application): 

11 bj = application.bibjson() 

12 assert isinstance(bj, JournalLikeBibJSON) 

13 

14 record = {} 

15 record["doaj_id"] = application.id 

16 record["pissn"] = bj.pissn 

17 record["eissn"] = bj.eissn 

18 record["author_retains_copyright"] = bj.author_retains_copyright 

19 record["publishing_license"] = [x.get("type") for x in bj.licenses] 

20 record["pids"] = bj.pid_scheme 

21 record["preservation"] = bj.flattened_archiving_policies 

22 record["license_embedded"] = "Embed" in bj.article_license_display 

23 record["pricing_info"] = bj.has_apc or bj.has_other_charges 

24 record["waiver"] = bj.has_waiver 

25 

26 return record