<s> from django . contrib . auth . models import User <EOL> from django . contrib . comments . forms import CommentForm <EOL> from django . contrib . comments . models import Comment <EOL> from django . contrib . contenttypes . models import ContentType <EOL> from django . contrib . sites . models import Site <EOL> from django . test import TestCase <EOL> from regressiontests . comment_tests . models import Article , Author <EOL> CT = ContentType . objects . get_for_model <EOL> class CommentTestCase ( TestCase ) : <EOL> fixtures = [ "<STR_LIT>" ] <EOL> urls = '<STR_LIT>' <EOL> def createSomeComments ( self ) : <EOL> c1 = Comment . objects . create ( <EOL> content_type = CT ( Article ) , <EOL> object_pk = "<STR_LIT:1>" , <EOL> user_name = "<STR_LIT>" , <EOL> user_email = "<STR_LIT>" , <EOL> user_url = "<STR_LIT>" , <EOL> comment = "<STR_LIT>" , <EOL> site = Site . objects . get_current ( ) , <EOL> ) <EOL> c2 = Comment . objects . create ( <EOL> content_type = CT ( Author ) , <EOL> object_pk = "<STR_LIT:1>" , <EOL> user_name = "<STR_LIT>" , <EOL> user_email = "<STR_LIT>" , <EOL> user_url = "<STR_LIT>" , <EOL> comment = "<STR_LIT>" , <EOL> site = Site . objects . get_current ( ) , <EOL> ) <EOL> user = User . objects . create ( <EOL> username = "<STR_LIT>" , <EOL> first_name = "<STR_LIT>" , <EOL> last_name = "<STR_LIT>" , <EOL> email = "<STR_LIT>" , <EOL> password = "<STR_LIT>" , <EOL> is_staff = False , <EOL> is_active = True , <EOL> is_superuser = False , <EOL> ) <EOL> c3 = Comment . objects . create ( <EOL> content_type = CT ( Article ) , <EOL> object_pk = "<STR_LIT:1>" , <EOL> user = user , <EOL> user_url = "<STR_LIT>" , <EOL> comment = "<STR_LIT>" , <EOL> site = Site . objects . get_current ( ) , <EOL> ) <EOL> c4 = Comment . objects . create ( <EOL> content_type = CT ( Author ) , <EOL> object_pk = "<STR_LIT:2>" , <EOL> user = user , <EOL> user_url = "<STR_LIT>" , <EOL> comment = "<STR_LIT>" , <EOL> site = Site . objects . get_current ( ) , <EOL> ) <EOL> return c1 , c2 , c3 , c4 <EOL> def getData ( self ) : <EOL> return { <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT:email>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def getValidData ( self , obj ) : <EOL> f = CommentForm ( obj ) <EOL> d = self . getData ( ) <EOL> d . update ( f . initial ) <EOL> return d <EOL> from regressiontests . comment_tests . tests . app_api_tests import * <EOL> from regressiontests . comment_tests . tests . model_tests import * <EOL> from regressiontests . comment_tests . tests . comment_form_tests import * <EOL> from regressiontests . comment_tests . tests . templatetag_tests import * <EOL> from regressiontests . comment_tests . tests . comment_view_tests import * <EOL> from regressiontests . comment_tests . tests . moderation_view_tests import * </s>
