| 6 | | 16 | |
|---|
| 7 | def test_index(self): | 17 | def test_index(self): |
|---|
| 8 | url = url_for(controller='text') | 18 | url = url_for(controller='text') |
|---|
| 9 | res = self.app.get(url) | 19 | res = self.app.get(url) |
|---|
| 10 | print res | 20 | print res |
|---|
| 11 | assert "Shakespeare's Works" in res | 21 | assert "Shakespeare's Works" in res |
|---|
| 12 | assert 'The Tempest' in res | 22 | assert 'The Tempest' in res |
|---|
| 13 | | 23 | |
|---|
| 14 | def test_view_1(self): | 24 | def test_view_1(self): |
|---|
| 15 | url = url_for(controller='text', action='view', name='tempest_gut', | 25 | url = url_for(controller='text', action='view', name='tempest_gut', |
|---|
| 16 | format='plain') | 26 | format='plain') |
|---|
| 17 | res = self.app.get(url) | 27 | res = self.app.get(url) |
|---|
| 18 | assert 'CALIBAN, a savage and deformed Slave' in res | 28 | assert 'CALIBAN, a savage and deformed Slave' in res |
|---|
| 19 | | 29 | |
|---|
| 20 | def test_index_2(self): | 30 | def test_index_2(self): |
|---|
| 21 | url = url_for(controller='text') | 31 | url = url_for(controller='text') |
|---|
| 22 | res = self.app.get(url) | 32 | res = self.app.get(url) |
|---|
| 23 | res = res.click('The Tempest', index=0) | 33 | res = res.click('The Tempest', index=0) |
|---|
| 24 | assert 'CALIBAN, a savage and deformed Slave' in res | 34 | assert 'CALIBAN, a savage and deformed Slave' in res |
|---|
| 25 | | 35 | |
|---|
| 26 | def test_view_2(self): | 36 | def test_view_2(self): |
|---|
| 27 | url = url_for(controller='text', action='view', | 37 | url = url_for(controller='text', action='view', |
|---|
| 28 | name=['tempest_gut','tempest_gut_f'], format='plain') | 38 | name=['tempest_gut','tempest_gut_f'], format='plain') |
|---|
| 29 | res = self.app.get(url) | 39 | res = self.app.get(url) |
|---|
| 30 | assert 'CALIBAN, a savage and deformed Slave' in res | 40 | assert 'CALIBAN, a savage and deformed Slave' in res |
|---|
| 31 | | 41 | |
|---|
| 32 | def test_view_3(self): | 42 | def test_view_3(self): |
|---|
| 33 | url = url_for(controller='text', action='view', | 43 | url = url_for(controller='text', action='view', |
|---|
| 34 | name=['tempest_gut', 'tempest_gut_f'], format='raw') | 44 | name=['tempest_gut', 'tempest_gut_f'], format='raw') |
|---|
| 35 | res = self.app.get(url) | 45 | res = self.app.get(url) |
|---|
| 36 | assert 'CALIBAN, a savage and deformed Slave' in res | 46 | assert 'CALIBAN, a savage and deformed Slave' in res |
|---|
| 37 | | 47 | |
|---|
| 38 | def test_view_with_unicode_source(self): | 48 | def test_view_with_unicode_source(self): |
|---|
| 39 | url = url_for(controller='text', action='view', | 49 | url = url_for(controller='text', action='view', |
|---|
| 40 | name='all_is_well_that_ends_well_gut_f', format='plain') | 50 | name='all_is_well_that_ends_well_gut_f', format='plain') |
|---|
| 41 | res = self.app.get(url) | 51 | res = self.app.get(url) |
|---|
| 42 | assert "All's Well, that Ends Well" in res | 52 | assert "All's Well, that Ends Well" in res |
|---|
| 43 | | 53 | |
|---|