<s> from datetime import date <EOL> from kitsune . customercare . badges import AOA_BADGE <EOL> from kitsune . customercare . tests import ReplyFactory <EOL> from kitsune . kbadge . tests import BadgeFactory <EOL> from kitsune . sumo . tests import TestCase <EOL> from kitsune . users . tests import UserFactory <EOL> from kitsune . customercare . badges import register_signals <EOL> class TestAOABadges ( TestCase ) : <EOL> def setUp ( self ) : <EOL> register_signals ( ) <EOL> def test_aoa_badge ( self ) : <EOL> """<STR_LIT>""" <EOL> year = date . today ( ) . year <EOL> u = UserFactory ( ) <EOL> b = BadgeFactory ( <EOL> slug = AOA_BADGE [ '<STR_LIT>' ] . format ( year = year ) , <EOL> title = AOA_BADGE [ '<STR_LIT:title>' ] . format ( year = year ) , <EOL> description = AOA_BADGE [ '<STR_LIT:description>' ] . format ( year = year ) ) <EOL> for _ in range ( <NUM_LIT> ) : <EOL> ReplyFactory ( user = u ) <EOL> assert not b . is_awarded_to ( u ) <EOL> ReplyFactory ( user = u ) <EOL> assert b . is_awarded_to ( u ) </s>
