Show More
@@ -172,9 +172,9 b' class TestLibs(BaseTestCase):' | |||
|
172 | 172 | |
|
173 | 173 | def fake_conf(**kwargs): |
|
174 | 174 | from pylons import config |
|
175 |
config |
|
|
176 |
config |
|
|
177 |
config |
|
|
175 | config = {} | |
|
176 | config['use_gravatar'] = True | |
|
177 | config.update(kwargs) | |
|
178 | 178 | return config |
|
179 | 179 | |
|
180 | 180 | class fake_url(): |
@@ -184,31 +184,31 b' class TestLibs(BaseTestCase):' | |||
|
184 | 184 | |
|
185 | 185 | with mock.patch('pylons.url', fake_url): |
|
186 | 186 | fake = fake_conf(alternative_gravatar_url='http://test.com/{email}') |
|
187 |
with mock.patch(' |
|
|
187 | with mock.patch('rhodecode.CONFIG', fake): | |
|
188 | 188 | from pylons import url |
|
189 | 189 | assert url.current() == 'https://server.com' |
|
190 | 190 | grav = gravatar_url(email_address='test@foo.com', size=24) |
|
191 | 191 | assert grav == 'http://test.com/test@foo.com' |
|
192 | 192 | |
|
193 | 193 | fake = fake_conf(alternative_gravatar_url='http://test.com/{email}') |
|
194 |
with mock.patch(' |
|
|
194 | with mock.patch('rhodecode.CONFIG', fake): | |
|
195 | 195 | grav = gravatar_url(email_address='test@foo.com', size=24) |
|
196 | 196 | assert grav == 'http://test.com/test@foo.com' |
|
197 | 197 | |
|
198 | 198 | fake = fake_conf(alternative_gravatar_url='http://test.com/{md5email}') |
|
199 |
with mock.patch(' |
|
|
199 | with mock.patch('rhodecode.CONFIG', fake): | |
|
200 | 200 | em = 'test@foo.com' |
|
201 | 201 | grav = gravatar_url(email_address=em, size=24) |
|
202 | 202 | assert grav == 'http://test.com/%s' % (_md5(em)) |
|
203 | 203 | |
|
204 | 204 | fake = fake_conf(alternative_gravatar_url='http://test.com/{md5email}/{size}') |
|
205 |
with mock.patch(' |
|
|
205 | with mock.patch('rhodecode.CONFIG', fake): | |
|
206 | 206 | em = 'test@foo.com' |
|
207 | 207 | grav = gravatar_url(email_address=em, size=24) |
|
208 | 208 | assert grav == 'http://test.com/%s/%s' % (_md5(em), 24) |
|
209 | 209 | |
|
210 | 210 | fake = fake_conf(alternative_gravatar_url='{scheme}://{netloc}/{md5email}/{size}') |
|
211 |
with mock.patch(' |
|
|
211 | with mock.patch('rhodecode.CONFIG', fake): | |
|
212 | 212 | em = 'test@foo.com' |
|
213 | 213 | grav = gravatar_url(email_address=em, size=24) |
|
214 | 214 | assert grav == 'https://server.com/%s/%s' % (_md5(em), 24) |
General Comments 0
You need to be logged in to leave comments.
Login now