<s> from datetime import datetime <EOL> from django . http import HttpRequest <EOL> from django . conf import settings <EOL> from django . utils . importlib import import_module <EOL> from django . contrib . auth . models import User <EOL> def get_request ( ) : <EOL> request = HttpRequest ( ) <EOL> engine = import_module ( settings . SESSION_ENGINE ) <EOL> request . session = engine . SessionStore ( None ) <EOL> return request <EOL> class TestStorage ( object ) : <EOL> def setUp ( self ) : <EOL> self . testuser , created = User . objects . get_or_create ( username = '<STR_LIT>' ) <EOL> def test_current_step ( self ) : <EOL> request = get_request ( ) <EOL> storage = self . get_storage ( ) ( '<STR_LIT>' , request , None ) <EOL> my_step = <NUM_LIT:2> <EOL> self . assertEqual ( storage . current_step , None ) <EOL> storage . current_step = my_step <EOL> self . assertEqual ( storage . current_step , my_step ) <EOL> storage . reset ( ) <EOL> self . assertEqual ( storage . current_step , None ) <EOL> storage . current_step = my_step <EOL> storage2 = self . get_storage ( ) ( '<STR_LIT>' , request , None ) <EOL> self . assertEqual ( storage2 . current_step , None ) <EOL> def test_step_data ( self ) : <EOL> request = get_request ( ) <EOL> storage = self . get_storage ( ) ( '<STR_LIT>' , request , None ) <EOL> step1 = '<STR_LIT:start>' <EOL> step_data1 = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : datetime . now ( ) , <EOL> '<STR_LIT>' : self . testuser } <EOL> self . assertEqual ( storage . get_step_data ( step1 ) , None ) <EOL> storage . set_step_data ( step1 , step_data1 ) <EOL> self . assertEqual ( storage . get_step_data ( step1 ) , step_data1 ) <EOL> storage . reset ( ) <EOL> self . assertEqual ( storage . get_step_data ( step1 ) , None ) <EOL> storage . set_step_data ( step1 , step_data1 ) <EOL> storage2 = self . get_storage ( ) ( '<STR_LIT>' , request , None ) <EOL> self . assertEqual ( storage2 . get_step_data ( step1 ) , None ) <EOL> def test_extra_context ( self ) : <EOL> request = get_request ( ) <EOL> storage = self . get_storage ( ) ( '<STR_LIT>' , request , None ) <EOL> extra_context = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : datetime . now ( ) , <EOL> '<STR_LIT>' : self . testuser } <EOL> self . assertEqual ( storage . extra_data , { } ) <EOL> storage . extra_data = extra_context <EOL> self . assertEqual ( storage . extra_data , extra_context ) <EOL> storage . reset ( ) <EOL> self . assertEqual ( storage . extra_data , { } ) <EOL> storage . extra_data = extra_context <EOL> storage2 = self . get_storage ( ) ( '<STR_LIT>' , request , None ) <EOL> self . assertEqual ( storage2 . extra_data , { } ) </s>
