#NEWLINE# def test_something( self ) : #NEWLINE# #INDENT# feature = Feature . objects . create ( name = 'fftestfeature' ) #NEWLINE# user = User . objects . create_user ( 'fftestuser' , '' , 'password' ) #NEWLINE# c = Client ( ) #NEWLINE# self . assertTrue ( c . login ( username = 'fftestuser' , password = 'password' ) ) #NEWLINE# response = c . get ( '/' ) #NEWLINE# self . assertTrue ( ( 'features' in response . context ) ) #NEWLINE# self . assertTrue ( ( 'fftestfeature' in response . context [ 'features' ] ) ) #NEWLINE# self . assertFalse ( response . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# response = c . get ( '/?enable_fftestfeature' ) #NEWLINE# self . assertTrue ( response . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# response = c . get ( '/' ) #NEWLINE# self . assertFalse ( response . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# response = c . get ( '/?session_enable_fftestfeature' ) #NEWLINE# self . assertFalse ( response . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# perm = Permission . objects . get ( codename = 'can_flip_with_url' ) #NEWLINE# user . user_permissions . add ( perm ) #NEWLINE# self . assertTrue ( user . has_perm ( 'featureflipper.can_flip_with_url' ) ) #NEWLINE# response = c . get ( '/?session_enable_fftestfeature' ) #NEWLINE# self . assertTrue ( response . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# response = c . get ( '/' ) #NEWLINE# self . assertTrue ( response . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# response = c . get ( '/?session_clear_features' ) #NEWLINE# self . assertFalse ( self . context [ 'features' ] [ 'fftestfeature' ] ) #NEWLINE# feature . delete ( ) #NEWLINE# user . delete ( )