-
Notifications
You must be signed in to change notification settings - Fork 16
/
accounts.py
89 lines (70 loc) · 1.88 KB
/
accounts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
from copy import deepcopy
class AccountFixtureFactory(object):
@staticmethod
def make_publisher_source():
return deepcopy(PUBLISHER_SOURCE)
@staticmethod
def make_managing_editor_source():
return deepcopy(MANED_SOURCE)
@staticmethod
def make_editor_source():
return deepcopy(EDITOR_SOURCE)
@staticmethod
def make_assed1_source():
return deepcopy(ASSED_SOURCE1)
@staticmethod
def make_assed2_source():
return deepcopy(ASSED_SOURCE2)
@staticmethod
def make_assed3_source():
return deepcopy(ASSED_SOURCE3)
PUBLISHER_SOURCE = {
"email": "pub@example.com",
"name": "Joe Publisher",
"role": ['publisher', 'api'],
"id": "publisher"
}
PUBLISHER_B_SOURCE = {
"email": "pub_b@example.com",
"name": "Publisher bbbbb",
"role": ['publisher', 'api'],
"id": "publisher_b"
}
MANED_SOURCE = {
"email": "maned@example.com",
"name": "Managing Editor / Administrator",
"role": ['admin', 'api'],
"id": "maned"
}
EDITOR_SOURCE = {
"email": "eddie@example.com",
"name": "Eddie",
"role": ["editor"],
"id": "eddie"
}
ASSED_SOURCE1 = {
"email": "associate@example.com",
"name": "Associate One",
"role": ["associate_editor"],
"id": "associate"
}
ASSED_SOURCE2 = {
"email": "associate_2@example.com",
"name": "Associate Two",
"role": ["associate_editor"],
"id": "associate_2"
}
ASSED_SOURCE3 = {
"email": "associate_3@example.com",
"name": "Associate Three",
"role": ["associate_editor"],
"id": "associate_3"
}
def create_publisher_a():
from portality import models
publisher = models.Account(**AccountFixtureFactory.make_publisher_source())
return publisher
def create_maned_a():
from portality import models
maned = models.Account(**AccountFixtureFactory.make_managing_editor_source())
return maned