<s> from __future__ import absolute_import <EOL> from django . template import Context , Template <EOL> from mock import Mock <EOL> from sentry . plugins import Plugin2 <EOL> from sentry . testutils import PluginTestCase <EOL> class SamplePlugin ( Plugin2 ) : <EOL> def get_actions ( self , request , group ) : <EOL> return [ ( '<STR_LIT>' , '<STR_LIT>' % ( group . id , ) ) ] <EOL> def get_annotations ( self , group ) : <EOL> return [ <EOL> { '<STR_LIT:label>' : '<STR_LIT>' , '<STR_LIT:url>' : '<STR_LIT>' % ( group . id , ) } , <EOL> { '<STR_LIT:label>' : '<STR_LIT>' } , <EOL> ] <EOL> def is_enabled ( self , project = None ) : <EOL> return True <EOL> class GetActionsTest ( PluginTestCase ) : <EOL> plugin = SamplePlugin <EOL> TEMPLATE = Template ( """<STR_LIT>""" ) <EOL> def test_includes_v2_plugins ( self ) : <EOL> group = self . create_group ( ) <EOL> result = self . TEMPLATE . render ( Context ( { <EOL> '<STR_LIT>' : Mock ( ) , <EOL> '<STR_LIT>' : group , <EOL> } ) ) <EOL> assert '<STR_LIT>' % ( group . id , ) in result <EOL> class GetAnnotationsTest ( PluginTestCase ) : <EOL> plugin = SamplePlugin <EOL> TEMPLATE = Template ( """<STR_LIT>""" ) <EOL> def test_includes_v2_plugins ( self ) : <EOL> group = self . create_group ( ) <EOL> result = self . TEMPLATE . render ( Context ( { <EOL> '<STR_LIT>' : Mock ( ) , <EOL> '<STR_LIT>' : group , <EOL> } ) ) <EOL> assert '<STR_LIT>' % ( group . id , ) in result <EOL> assert '<STR_LIT>' in result </s>
