@@ -94,10 +94,11 @@ def compare(self, data):
9494 webapp = self .get_webapp ()
9595 for k , v in data .iteritems ():
9696 k = mapping .get (k , k )
97-
9897 val = getattr (webapp , k , '' )
9998 if callable (val ):
10099 val = val ()
100+ if val is None :
101+ val = ''
101102
102103 eq_ (unicode (val ), unicode (v ))
103104
@@ -1387,38 +1388,25 @@ def test_log(self):
13871388 def test_toggles (self ):
13881389 # Turn everything on.
13891390 data = dict (developer_comments = 'Test comment!' ,
1390- external_software = 'on' ,
1391- site_specific = 'on' ,
1392- view_source = 'on' )
1393-
1391+ flash = 'checked' )
13941392 r = self .client .post (self .edit_url , formset (** data ))
13951393 self .assertNoFormErrors (r )
13961394 expected = dict (developer_comments = 'Test comment!' ,
1397- external_software = True ,
1398- site_specific = True ,
1399- view_source = True )
1395+ uses_flash = True )
14001396 self .compare (expected )
14011397
14021398 # And off.
14031399 r = self .client .post (self .edit_url ,
14041400 formset (developer_comments = 'Test comment!' ))
1405- expected .update (external_software = False ,
1406- site_specific = False ,
1407- view_source = False )
1401+ expected .update (uses_flash = False )
14081402 self .compare (expected )
14091403
14101404 def test_devcomment_optional (self ):
1411- data = dict (developer_comments = '' ,
1412- external_software = 'on' ,
1413- site_specific = 'on' ,
1414- view_source = 'on' )
1405+ data = dict (developer_comments = '' )
14151406 r = self .client .post (self .edit_url , formset (** data ))
14161407 self .assertNoFormErrors (r )
14171408
1418- expected = dict (developer_comments = '' ,
1419- external_software = True ,
1420- site_specific = True ,
1421- view_source = True )
1409+ expected = dict (developer_comments = '' )
14221410 self .compare (expected )
14231411
14241412
@@ -1584,42 +1572,6 @@ def test_ratings_view(self):
15841572 '%s - %s' % (RATINGS_BODIES [0 ].name ,
15851573 RATINGS_BODIES [0 ].ratings [2 ].name ))
15861574
1587- def test_set_flash (self ):
1588- self .log_in_with ('Apps:Configure' )
1589- r = self .client .post (self .edit_url ,
1590- {'caption' : 'x' ,
1591- 'position' : '1' ,
1592- 'upload_hash' : 'abcdef' ,
1593- 'flash' : 'checked' })
1594- eq_ (r .status_code , 200 )
1595- assert self .webapp .uses_flash
1596-
1597- def test_unset_flash (self ):
1598- self .webapp .versions .latest ().files .latest ().update (uses_flash = True )
1599- self .log_in_with ('Apps:Configure' )
1600- r = self .client .post (self .edit_url ,
1601- {'caption' : 'x' ,
1602- 'position' : '1' ,
1603- 'upload_hash' : 'abcdef' ,
1604- 'flash' : '' })
1605- eq_ (r .status_code , 200 )
1606- assert not self .webapp .uses_flash
1607-
1608- def test_flash_set_view (self ):
1609- self .log_in_with ('Apps:ViewConfiguration' )
1610- self .webapp .versions .latest ().files .latest ().update (uses_flash = True )
1611- r = self .client .get (self .url )
1612- checkbox = pq (r .content )[0 ].xpath (
1613- "//label[@for='flash']/../../td/input" )[0 ]
1614- eq_ (checkbox .get ('checked' ), 'checked' )
1615-
1616- def test_flash_unset_view (self ):
1617- self .log_in_with ('Apps:ViewConfiguration' )
1618- r = self .client .get (self .url )
1619- checkbox = pq (r .content )[0 ].xpath (
1620- "//label[@for='flash']/../../td/input" )[0 ]
1621- eq_ (checkbox .get ('checked' ), None )
1622-
16231575
16241576class TestPromoUpload (TestAdmin ):
16251577
0 commit comments