<s> import unittest <EOL> from app import create_app , db <EOL> from app . models import PendingEmail , User , Talk <EOL> class CommentModelTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . app = create_app ( '<STR_LIT>' ) <EOL> self . app_context = self . app . app_context ( ) <EOL> self . app_context . push ( ) <EOL> def tearDown ( self ) : <EOL> db . session . remove ( ) <EOL> db . drop_all ( ) <EOL> self . app_context . pop ( ) <EOL> def test_queue ( self ) : <EOL> db . create_all ( ) <EOL> u = User ( email = '<STR_LIT>' , username = '<STR_LIT>' , password = '<STR_LIT>' ) <EOL> t1 = Talk ( title = '<STR_LIT>' , description = '<STR_LIT:d>' , author = u ) <EOL> t2 = Talk ( title = '<STR_LIT>' , description = '<STR_LIT:d>' , author = u ) <EOL> p = PendingEmail ( name = '<STR_LIT:n>' , email = '<STR_LIT>' , subject = '<STR_LIT:s>' , <EOL> body_text = '<STR_LIT:t>' , body_html = '<STR_LIT:h>' , talk = t1 ) <EOL> db . session . add_all ( [ u , t1 , t2 , p ] ) <EOL> db . session . commit ( ) <EOL> self . assertTrue ( <EOL> PendingEmail . already_in_queue ( '<STR_LIT>' , t1 ) == True ) <EOL> self . assertTrue ( <EOL> PendingEmail . already_in_queue ( '<STR_LIT>' , t1 ) == False ) <EOL> self . assertTrue ( <EOL> PendingEmail . already_in_queue ( '<STR_LIT>' , t2 ) == False ) </s>
