<s> from oscar . core . loading import get_model <EOL> from oscar . test . factories import create_product <EOL> from oscar . test . testcases import WebTestCase <EOL> WishList = get_model ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> class TestProductDetailPage ( WebTestCase ) : <EOL> is_anonymous = False <EOL> def setUp ( self ) : <EOL> super ( TestProductDetailPage , self ) . setUp ( ) <EOL> self . product = create_product ( ) <EOL> def test_allows_a_product_to_be_added_to_wishlist ( self ) : <EOL> detail_page = self . get ( self . product . get_absolute_url ( ) ) <EOL> form = detail_page . forms [ '<STR_LIT>' ] <EOL> response = form . submit ( ) <EOL> self . assertIsRedirect ( response ) <EOL> wishlists = self . user . wishlists . all ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( wishlists ) ) <EOL> lines = wishlists [ <NUM_LIT:0> ] . lines . all ( ) <EOL> self . assertEqual ( <NUM_LIT:1> , len ( lines ) ) <EOL> self . assertEqual ( self . product , lines [ <NUM_LIT:0> ] . product ) </s>
