<s> """<STR_LIT>""" <EOL> from django . test import TestCase <EOL> from django . contrib . auth . tests . utils import skipIfCustomUser <EOL> from zinnia import flags <EOL> from zinnia . flags import get_user_flagger <EOL> @ skipIfCustomUser <EOL> class FlagsTestCase ( TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> self . clear_user_flagger_cache ( ) <EOL> def clear_user_flagger_cache ( self ) : <EOL> get_user_flagger . cache_clear ( ) <EOL> def test_get_user_flagger_cache ( self ) : <EOL> get_user_flagger ( ) <EOL> with self . assertNumQueries ( <NUM_LIT:0> ) : <EOL> get_user_flagger ( ) <EOL> def test_get_user_flagger_does_not_exist ( self ) : <EOL> original_user_id = flags . COMMENT_FLAG_USER_ID <EOL> flags . COMMENT_FLAG_USER_ID = <NUM_LIT> <EOL> flagger = get_user_flagger ( ) <EOL> self . assertEqual ( flagger . username , '<STR_LIT>' ) <EOL> flags . COMMENT_FLAG_USER_ID = original_user_id <EOL> def test_get_user_flagged_does_not_exist_twice_issue_245 ( self ) : <EOL> original_user_id = flags . COMMENT_FLAG_USER_ID <EOL> flags . COMMENT_FLAG_USER_ID = None <EOL> flagger = get_user_flagger ( ) <EOL> self . assertEqual ( flagger . username , '<STR_LIT>' ) <EOL> self . clear_user_flagger_cache ( ) <EOL> flagger = get_user_flagger ( ) <EOL> self . assertEqual ( flagger . username , '<STR_LIT>' ) <EOL> flags . COMMENT_FLAG_USER_ID = original_user_id </s>
