Skip to content

Commit

Permalink
removed duplicate var in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Park authored and anandology committed Jan 5, 2011
1 parent 5506770 commit ad1d25d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cookbook/testing_with_paste_and_nose.md
Expand Up @@ -18,8 +18,8 @@ You want to test your web.py application.
class TestCode(): class TestCode():
def test_index(self): def test_index(self):
middleware = [] middleware = []
app = TestApp(app.wsgifunc(*middleware)) testApp = TestApp(app.wsgifunc(*middleware))
r = app.get('/') r = testApp.get('/')
assert_equal(r.status, 200) assert_equal(r.status, 200)
r.mustcontain('Hello, world!') r.mustcontain('Hello, world!')


Expand All @@ -42,7 +42,7 @@ Most of the code example above should be fairly self-explanatory. From our main


To set up the test, we pass its wsgifunc() to Paste's TestApp, as you have already seen in the example. To set up the test, we pass its wsgifunc() to Paste's TestApp, as you have already seen in the example.


app = TestApp(app.wsgifunc(*middleware)) testApp = TestApp(app.wsgifunc(*middleware))


assert_equal() is one of the methods provided by nose's utils, and works just like unittest's assertEqual(). assert_equal() is one of the methods provided by nose's utils, and works just like unittest's assertEqual().


Expand All @@ -66,4 +66,4 @@ Then, it's simply a matter of running nosetests like so:


WEBPY_ENV=test nosetests WEBPY_ENV=test nosetests


The is_test() function comes in handy for other things, such as doing conditional database commits to avoid test database pollution. The is_test() function comes in handy for other things, such as doing conditional database commits to avoid test database pollution.

0 comments on commit ad1d25d

Please sign in to comment.