<s> from __future__ import absolute_import <EOL> import unittest <EOL> import django <EOL> from django . conf import settings <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . test . utils import override_settings <EOL> from django . utils import six <EOL> import django_comments <EOL> from django_comments . models import Comment <EOL> from django_comments . forms import CommentForm <EOL> from . import CommentTestCase <EOL> class CommentAppAPITests ( CommentTestCase ) : <EOL> """<STR_LIT>""" <EOL> def testGetCommentApp ( self ) : <EOL> self . assertEqual ( django_comments . get_comment_app ( ) , django_comments ) <EOL> @ unittest . skipIf ( django . VERSION >= ( <NUM_LIT:1> , <NUM_LIT:7> ) , "<STR_LIT>" ) <EOL> @ override_settings ( <EOL> COMMENTS_APP = '<STR_LIT>' , <EOL> INSTALLED_APPS = list ( settings . INSTALLED_APPS ) + [ '<STR_LIT>' ] , <EOL> ) <EOL> def testGetMissingCommentApp ( self ) : <EOL> with six . assertRaisesRegex ( self , ImproperlyConfigured , '<STR_LIT>' ) : <EOL> django_comments . get_comment_app ( ) <EOL> def testGetForm ( self ) : <EOL> self . assertEqual ( django_comments . get_form ( ) , CommentForm ) <EOL> def testGetFormTarget ( self ) : <EOL> self . assertEqual ( django_comments . get_form_target ( ) , "<STR_LIT>" ) <EOL> def testGetFlagURL ( self ) : <EOL> c = Comment ( id = <NUM_LIT> ) <EOL> self . assertEqual ( django_comments . get_flag_url ( c ) , "<STR_LIT>" ) <EOL> def getGetDeleteURL ( self ) : <EOL> c = Comment ( id = <NUM_LIT> ) <EOL> self . assertEqual ( django_comments . get_delete_url ( c ) , "<STR_LIT>" ) <EOL> def getGetApproveURL ( self ) : <EOL> c = Comment ( id = <NUM_LIT> ) <EOL> self . assertEqual ( django_comments . get_approve_url ( c ) , "<STR_LIT>" ) <EOL> @ override_settings ( <EOL> COMMENTS_APP = '<STR_LIT>' , ROOT_URLCONF = '<STR_LIT>' , <EOL> ) <EOL> class CustomCommentTest ( CommentTestCase ) : <EOL> def testGetCommentApp ( self ) : <EOL> import custom_comments <EOL> self . assertEqual ( django_comments . get_comment_app ( ) , custom_comments ) <EOL> def testGetModel ( self ) : <EOL> from custom_comments . models import CustomComment <EOL> self . assertEqual ( django_comments . get_model ( ) , CustomComment ) <EOL> def testGetForm ( self ) : <EOL> from custom_comments . forms import CustomCommentForm <EOL> self . assertEqual ( django_comments . get_form ( ) , CustomCommentForm ) <EOL> def testGetFormTarget ( self ) : <EOL> self . assertEqual ( django_comments . get_form_target ( ) , "<STR_LIT>" ) <EOL> def testGetFlagURL ( self ) : <EOL> c = Comment ( id = <NUM_LIT> ) <EOL> self . assertEqual ( django_comments . get_flag_url ( c ) , "<STR_LIT>" ) <EOL> def getGetDeleteURL ( self ) : <EOL> c = Comment ( id = <NUM_LIT> ) <EOL> self . assertEqual ( django_comments . get_delete_url ( c ) , "<STR_LIT>" ) <EOL> def getGetApproveURL ( self ) : <EOL> c = Comment ( id = <NUM_LIT> ) <EOL> self . assertEqual ( django_comments . get_approve_url ( c ) , "<STR_LIT>" ) </s>
