@@ -23,30 +23,22 @@ def test_01_live_preview_enabled_(self):
23
23
config .delivery_token ,
24
24
config .environment ,
25
25
live_preview = _preview )
26
- entry = self .stack .content_type ('live_content_type' ).entry ('live_entry_uid' )
26
+ self .stack .content_type (
27
+ 'live_content_type' ).entry ('live_entry_uid' )
27
28
self .assertEqual (3 , len (self .stack .get_live_preview ))
28
29
self .assertTrue (self .stack .get_live_preview ['enable' ])
29
30
self .assertTrue (self .stack .get_live_preview ['authorization' ])
30
31
31
- def test_02_live_preview_enabled_ (self ):
32
- self .stack = contentstack .Stack (
33
- config .api_key ,
34
- config .delivery_token ,
35
- config .environment ,
36
- live_preview = _preview )
37
- self .assertEqual (3 , len (self .stack .live_preview_dict ))
38
- self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
39
-
40
32
def test_021_live_preview_enabled_ (self ):
41
33
self .stack = contentstack .Stack (
42
34
config .api_key ,
43
35
config .delivery_token ,
44
36
config .environment ,
45
37
live_preview = _preview )
46
- self .assertEqual (_preview ['authorization' ], self .stack .live_preview_dict ['authorization' ])
38
+ self .assertEqual (_preview ['authorization' ],
39
+ self .stack .live_preview_dict ['authorization' ])
47
40
48
41
def test_03_set_host (self ):
49
- host = 'abc.contentstack.com'
50
42
self .stack = contentstack .Stack (
51
43
config .api_key ,
52
44
config .delivery_token ,
@@ -56,32 +48,14 @@ def test_03_set_host(self):
56
48
self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
57
49
58
50
def test_031_set_host_value (self ):
59
- host = 'abc.contentstack.com'
60
- self .stack = contentstack .Stack (
61
- config .api_key ,
62
- config .delivery_token ,
63
- config .environment ,
64
- live_preview = _preview )
65
- self .assertEqual (3 , len (self .stack .live_preview_dict ))
66
- self .assertEqual (_preview ['host' ], self .stack .live_preview_dict ['host' ])
67
-
68
- def test_04_include_edit_tags (self ):
69
51
self .stack = contentstack .Stack (
70
52
config .api_key ,
71
53
config .delivery_token ,
72
54
config .environment ,
73
55
live_preview = _preview )
74
56
self .assertEqual (3 , len (self .stack .live_preview_dict ))
75
- self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
76
-
77
- def test_05_include_edit_tags_type (self ):
78
- self .stack = contentstack .Stack (
79
- config .api_key ,
80
- config .delivery_token ,
81
- config .environment ,
82
- live_preview = _preview )
83
- self .assertEqual (3 , len (self .stack .live_preview_dict ))
84
- self .assertEqual (True , self .stack .live_preview_dict ['enable' ])
57
+ self .assertEqual (_preview ['host' ],
58
+ self .stack .live_preview_dict ['host' ])
85
59
86
60
def test_06_live_preview_query (self ):
87
61
_live_preview = {
@@ -141,7 +115,15 @@ def test_09_live_preview_check_hash_value(self):
141
115
self .assertEqual (config .api_key , self .stack .headers ['api_key' ])
142
116
143
117
def test_branching (self ):
144
- stack = contentstack .Stack ('apiKey' , 'deliveryToken' , 'environment' , branch = 'dev_branch' )
118
+ stack = contentstack .Stack (
119
+ 'api_key' , 'delivery_token' , 'environment' , branch = 'dev_branch' )
145
120
stack .content_type ('product' )
146
121
self .assertEqual ('dev_branch' , stack .get_branch )
147
- self .assertTrue ('branch' in stack .headers )
122
+
123
+ def test_branching_header (self ):
124
+ stack = contentstack .Stack (
125
+ 'api_key' , 'delivery_token' , 'environment' , branch = 'dev_branch' )
126
+ stack .content_type ('product' )
127
+ has = 'branch' in stack .headers
128
+ if has :
129
+ self .assertTrue (has )
0 commit comments