Child: [cef067] (diff)

Download this file

test_feeds.py    81 lines (71 with data), 2.5 kB

 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
from formencode.variabledecode import variable_encode
from allura.tests import TestController
from allura.tests import decorators as td
class TestFeeds(TestController):
def setUp(self):
TestController.setUp(self)
self._setUp()
@td.with_wiki
@td.with_tracker
def _setUp(self):
self.app.get('/wiki/')
self.app.get('/bugs/')
self.app.post(
'/bugs/save_ticket',
params=variable_encode(dict(
ticket_form=dict(
ticket_num='',
labels='',
assigned_to='',
milestone='',
summary='This is a ticket',
status='open',
description='This is a description'))),
status=302)
title = u'Descri\xe7\xe3o e Arquitetura'.encode('utf-8')
self.app.post(
'/wiki/%s/update' % title,
params=dict(
title=title,
text="Nothing much",
labels='',
labels_old=''),
status=302)
self.app.get('/wiki/%s/' % title)
def test_project_feed(self):
self.app.get('/feed.rss')
self.app.get('/feed.atom')
@td.with_wiki
def test_wiki_feed(self):
self.app.get('/wiki/feed.rss')
self.app.get('/wiki/feed.atom')
@td.with_wiki
def test_wiki_page_feed(self):
self.app.post('/wiki/Root/update', params={
'title':'Root',
'text':'',
'labels':'',
'labels_old':'',
'viewable_by-0.id':'all'})
self.app.get('/wiki/Root/feed.rss')
self.app.get('/wiki/Root/feed.atom')
@td.with_tracker
def test_ticket_list_feed(self):
self.app.get('/bugs/feed.rss')
self.app.get('/bugs/feed.atom')
@td.with_tracker
def test_ticket_feed(self):
self.app.get('/bugs/1/feed.rss')
r = self.app.get('/bugs/1/feed.atom')
self.app.post('/bugs/1/update_ticket', params=dict(
assigned_to='',
ticket_num='',
labels='',
labels_old='',
summary='This is a new ticket',
status='unread',
milestone='',
description='This is another description'), extra_environ=dict(username='root'))
r = self.app.get('/bugs/1/feed.atom')
assert '=>' in r
assert '\n+' in r