Traceback most recent call last File home binary trunk aguila apps cit

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
Traceback (most recent call last):
File "/home/binary/trunk/aguila/apps/city/tests/test_views.py", line 94, in testShowBuildSite
keys = [ b for b in r1.context['buildings'] ]
File "/home/binary/trunk/aguila/libs/django/django/test/utils.py", line 18, in __getitem__
raise KeyError
KeyError
def testShowBuildSite(self):
c = Client()
c.login(username='binary', password='test')
r0 = c.get('/city/1/site/0/', follow=True)
self.assertEquals(r0.redirect_chain,
[(u'http://testserver/city/1/building/1/', 302)])
r1 = c.get('/city/1/site/1/')
self.assertEquals(r1.context['city'].name, 'Rome')
self.assertEquals(r1.context['site_id'], 1)
keys = [ b.game.key for b in r1.context['buildings'] ]
self.assertEquals('warehouse' in keys, True)
r21 = c.get('/city/6/site/21/')
self.assertEquals(r21.status_code, 404)