1
The main oops page allows searching for an oops report using the unique
4
>>> from oopstools.oops import djangobrowser
6
>>> b = djangobrowser.Browser()
7
>>> b.open('http://localhost/oops/')
10
'Search Launchpad OOPS Reports'
12
Using a invalid OOPS id the page returns a nice error message saying no OOPS
15
>>> b.getControl(name="oopsid").value = "foo"
16
>>> b.getControl("Search OOPS").click()
19
'http://localhost/oops/?oopsid=foo'
23
...Your search: <b>foo</b> didn't match any oops...
26
Using a valid OOPS id the OOPS page is correctly rendered.
28
>>> b.getControl(name="oopsid").value = "OOPS-689S4"
29
>>> b.getControl("Search OOPS").click()
32
'http://localhost/oops/?oopsid=OOPS-689S4'
36
...<title>OOPS-689S4</title>...
38
...<div id="request_variables">...
40
...<li>CHANNEL_CREATION_TIME: 1...</li>...
43
It also accepts the OOPS id without the "OOPS-" part.
45
>>> b.open('http://localhost/oops/')
46
>>> b.getControl(name="oopsid").value = "689S4"
47
>>> b.getControl("Search OOPS").click()
50
'http://localhost/oops/?oopsid=689S4'
54
...<title>OOPS-689S4</title>...
57
It doesn't care about case.
59
>>> b.open('http://localhost/oops/')
60
>>> b.getControl(name="oopsid").value = "oops-689S4"
61
>>> b.getControl("Search OOPS").click()
64
'http://localhost/oops/?oopsid=oops-689S4'
68
...<title>OOPS-689S4</title>...
71
It will also allow lower-case IDs with no OOPS- prefix, as used in ISD.
73
>>> b.open('http://localhost/oops/')
74
>>> b.getControl(name="oopsid").value = "1925canistelubuntu0"
75
>>> b.getControl("Search OOPS").click()
78
'http://localhost/oops/?oopsid=1925canistelubuntu0'
82
...<title>1925canistelubuntu0</title>...
85
If an OOPS is not in the database, the view uses as a fallback the OopsStore
86
to look for the oops report in the filesystem. First let's remove it from
89
>>> from oopstools.oops.models import Oops
90
>>> oops = Oops.objects.get(oopsid='OOPS-689S4')
93
>>> Oops.objects.get(oopsid='OOPS-689S4')
94
Traceback (most recent call last):
96
DoesNotExist: Oops matching query does not exist.
98
And try to search for the OOPS report again.
100
>>> b.open('http://localhost/oops/')
101
>>> b.getControl(name="oopsid").value = "OOPS-689S4"
102
>>> b.getControl("Search OOPS").click()
105
'http://localhost/oops/?oopsid=OOPS-689S4'
109
...<title>OOPS-689S4</title>...
112
Now the OOPS has been added to the database.
114
>>> Oops.objects.get(oopsid='OOPS-689S4')