Parent: [519f27] (diff)

Child: [763d18] (diff)

Download this file

test_root.py    55 lines (47 with data), 1.9 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
from nose.tools import assert_true, assert_false
from forgetracker.tests import TestController
from pyforge import model
class TestFunctionalController(TestController):
def test_new_ticket(self):
response = self.app.get('/bugs/new/')
form = response.form
summary = 'test new ticket'
form['summary'] = summary
response = form.submit().follow()
assert_true(summary in response)
def test_two_trackers(self):
response = self.app.get('/doc_bugs/new/')
form = response.form
summary = 'test two trackers'
form['summary'] = summary
response = form.submit().follow()
assert_true(summary in response)
response = self.app.get('/bugs/')
assert_false(summary in response)
def test_new_comment(self):
response = self.app.get('/bugs/new/')
form = response.form
form['summary'] = 'test new comment'
form.submit()
comment = 'comment testing new comment'
self.app.post('/bugs/1/comments/reply', { 'text': comment })
response = self.app.get('/bugs/1/')
assert_true(comment in response)
def test_render_ticket(self):
response = self.app.get('/bugs/new/')
form = response.form
summary = 'test render ticket'
form['summary'] = summary
response = form.submit().follow()
assert_true(summary in response)
assert_true('Attachments' in response)
assert_true('Comments' in response)
assert_true('Make a comment' in response)
def test_render_index(self):
response = self.app.get('/bugs/new/')
form = response.form
summary = 'test render index'
form['summary'] = summary
form.submit()
response = self.app.get('/bugs/')
assert_true(summary in response)