@@ 72-141 (lines=70) @@ | ||
69 | reply = create_reply(articles, render=False) |
|
70 | self.assertEqual('news', reply.type) |
|
71 | ||
72 | def test_create_reply_with_more_than_ten_articles(self): |
|
73 | articles = [ |
|
74 | { |
|
75 | 'title': 'test 1', |
|
76 | 'description': 'test 1', |
|
77 | 'image': 'http://www.qq.com/1.png', |
|
78 | 'url': 'http://www.qq.com/1' |
|
79 | }, |
|
80 | { |
|
81 | 'title': 'test 2', |
|
82 | 'description': 'test 2', |
|
83 | 'image': 'http://www.qq.com/2.png', |
|
84 | 'url': 'http://www.qq.com/2' |
|
85 | }, |
|
86 | { |
|
87 | 'title': 'test 3', |
|
88 | 'description': 'test 3', |
|
89 | 'image': 'http://www.qq.com/3.png', |
|
90 | 'url': 'http://www.qq.com/3' |
|
91 | }, |
|
92 | { |
|
93 | 'title': 'test 4', |
|
94 | 'description': 'test 4', |
|
95 | 'image': 'http://www.qq.com/4.png', |
|
96 | 'url': 'http://www.qq.com/4' |
|
97 | }, |
|
98 | { |
|
99 | 'title': 'test 5', |
|
100 | 'description': 'test 5', |
|
101 | 'image': 'http://www.qq.com/5.png', |
|
102 | 'url': 'http://www.qq.com/5' |
|
103 | }, |
|
104 | { |
|
105 | 'title': 'test 6', |
|
106 | 'description': 'test 6', |
|
107 | 'image': 'http://www.qq.com/6.png', |
|
108 | 'url': 'http://www.qq.com/6' |
|
109 | }, |
|
110 | { |
|
111 | 'title': 'test 7', |
|
112 | 'description': 'test 7', |
|
113 | 'image': 'http://www.qq.com/7.png', |
|
114 | 'url': 'http://www.qq.com/7' |
|
115 | }, |
|
116 | { |
|
117 | 'title': 'test 8', |
|
118 | 'description': 'test 8', |
|
119 | 'image': 'http://www.qq.com/8.png', |
|
120 | 'url': 'http://www.qq.com/8' |
|
121 | }, |
|
122 | { |
|
123 | 'title': 'test 9', |
|
124 | 'description': 'test 9', |
|
125 | 'image': 'http://www.qq.com/9.png', |
|
126 | 'url': 'http://www.qq.com/9' |
|
127 | }, |
|
128 | { |
|
129 | 'title': 'test 10', |
|
130 | 'description': 'test 10', |
|
131 | 'image': 'http://www.qq.com/10.png', |
|
132 | 'url': 'http://www.qq.com/10' |
|
133 | }, |
|
134 | { |
|
135 | 'title': 'test 11', |
|
136 | 'description': 'test 11', |
|
137 | 'image': 'http://www.qq.com/11.png', |
|
138 | 'url': 'http://www.qq.com/11' |
|
139 | }, |
|
140 | ] |
|
141 | self.assertRaises(AttributeError, create_reply, articles) |
|
142 |
@@ 69-138 (lines=70) @@ | ||
66 | self.assertEqual('news', reply.type) |
|
67 | reply.render() |
|
68 | ||
69 | def test_create_reply_with_more_than_ten_articles(self): |
|
70 | articles = [ |
|
71 | { |
|
72 | 'title': 'test 1', |
|
73 | 'description': 'test 1', |
|
74 | 'image': 'http://www.qq.com/1.png', |
|
75 | 'url': 'http://www.qq.com/1' |
|
76 | }, |
|
77 | { |
|
78 | 'title': 'test 2', |
|
79 | 'description': 'test 2', |
|
80 | 'image': 'http://www.qq.com/2.png', |
|
81 | 'url': 'http://www.qq.com/2' |
|
82 | }, |
|
83 | { |
|
84 | 'title': 'test 3', |
|
85 | 'description': 'test 3', |
|
86 | 'image': 'http://www.qq.com/3.png', |
|
87 | 'url': 'http://www.qq.com/3' |
|
88 | }, |
|
89 | { |
|
90 | 'title': 'test 4', |
|
91 | 'description': 'test 4', |
|
92 | 'image': 'http://www.qq.com/4.png', |
|
93 | 'url': 'http://www.qq.com/4' |
|
94 | }, |
|
95 | { |
|
96 | 'title': 'test 5', |
|
97 | 'description': 'test 5', |
|
98 | 'image': 'http://www.qq.com/5.png', |
|
99 | 'url': 'http://www.qq.com/5' |
|
100 | }, |
|
101 | { |
|
102 | 'title': 'test 6', |
|
103 | 'description': 'test 6', |
|
104 | 'image': 'http://www.qq.com/6.png', |
|
105 | 'url': 'http://www.qq.com/6' |
|
106 | }, |
|
107 | { |
|
108 | 'title': 'test 7', |
|
109 | 'description': 'test 7', |
|
110 | 'image': 'http://www.qq.com/7.png', |
|
111 | 'url': 'http://www.qq.com/7' |
|
112 | }, |
|
113 | { |
|
114 | 'title': 'test 8', |
|
115 | 'description': 'test 8', |
|
116 | 'image': 'http://www.qq.com/8.png', |
|
117 | 'url': 'http://www.qq.com/8' |
|
118 | }, |
|
119 | { |
|
120 | 'title': 'test 9', |
|
121 | 'description': 'test 9', |
|
122 | 'image': 'http://www.qq.com/9.png', |
|
123 | 'url': 'http://www.qq.com/9' |
|
124 | }, |
|
125 | { |
|
126 | 'title': 'test 10', |
|
127 | 'description': 'test 10', |
|
128 | 'image': 'http://www.qq.com/10.png', |
|
129 | 'url': 'http://www.qq.com/10' |
|
130 | }, |
|
131 | { |
|
132 | 'title': 'test 11', |
|
133 | 'description': 'test 11', |
|
134 | 'image': 'http://www.qq.com/11.png', |
|
135 | 'url': 'http://www.qq.com/11' |
|
136 | }, |
|
137 | ] |
|
138 | self.assertRaises(AttributeError, create_reply, articles) |
|
139 | ||
140 | def test_create_empty_reply(self): |
|
141 | from wechatpy.replies import EmptyReply |