#NEWLINE# def test_existing_page( self ) : #NEWLINE# #INDENT# t = datetime ( 2001 , 1 , 1 , 1 , 1 , 1 , 0 , utc ) #NEWLINE# self . env . db_transaction ( 'INSERT INTO wiki VALUES(%s,%s,%s,%s,%s,%s,%s,%s)' , ( 'TestPage' , 1 , to_utimestamp ( t ) , 'joe' , '::1' , 'Bla bla' , 'Testing' , 0 ) ) #NEWLINE# page = WikiPage ( self . env , 'TestPage' ) #NEWLINE# self . assertTrue ( page . exists ) #NEWLINE# self . assertEqual ( 'TestPage' , page . name ) #NEWLINE# self . assertEqual ( 1 , page . version ) #NEWLINE# self . assertIsNone ( page . resource . version ) #NEWLINE# self . assertEqual ( 'Bla bla' , page . text ) #NEWLINE# self . assertEqual ( 0 , page . readonly ) #NEWLINE# self . assertEqual ( 'joe' , page . author ) #NEWLINE# self . assertEqual ( 'Testing' , page . comment ) #NEWLINE# self . assertEqual ( t , page . time ) #NEWLINE# self . assertEqual ( "<WikiPage u'TestPage@1'>" , repr ( page ) ) #NEWLINE# history = list ( page . get_history ( ) ) #NEWLINE# self . assertEqual ( 1 , len ( history ) ) #NEWLINE# self . assertEqual ( ( 1 , t , 'joe' , 'Testing' , '::1' ) , history [ 0 ] ) #NEWLINE# page = WikiPage ( self . env , 'TestPage' , 1 ) #NEWLINE# self . assertEqual ( 1 , page . resource . version ) #NEWLINE# self . assertEqual ( 1 , page . version ) #NEWLINE# resource = Resource ( 'wiki' , 'TestPage' ) #NEWLINE# page = WikiPage ( self . env , resource , 1 ) #NEWLINE# self . assertEqual ( 1 , page . version )