<s> """<STR_LIT>""" <EOL> from django . core . urlresolvers import resolve , reverse <EOL> from django . test import TestCase <EOL> from sparkle . views import SparkleView <EOL> class URLTestMixin ( object ) : <EOL> def assert_url_matches_view ( self , view , expected_url , url_name , <EOL> url_args = None , url_kwargs = None , urlconf = None ) : <EOL> """<STR_LIT>""" <EOL> reversed_url = reverse ( <EOL> url_name , <EOL> urlconf = urlconf , <EOL> args = url_args , <EOL> kwargs = url_kwargs , <EOL> ) <EOL> self . assertEqual ( reversed_url , expected_url ) <EOL> resolved_view = resolve ( expected_url , urlconf = urlconf ) . func <EOL> if hasattr ( resolved_view , '<STR_LIT>' ) : <EOL> self . assertEqual ( resolved_view . cls , view ) <EOL> else : <EOL> self . assertEqual ( resolved_view . __name__ , view . __name__ ) <EOL> class Test ( URLTestMixin , TestCase ) : <EOL> def test_SparkleView ( self ) : <EOL> self . assert_url_matches_view ( SparkleView , '<STR_LIT>' , '<STR_LIT>' , <EOL> url_kwargs = dict ( app_name = '<STR_LIT>' , channel = '<STR_LIT>' ) ) </s>
