mirror of
https://github.com/Hopiu/django.git
synced 2026-03-28 20:00:23 +00:00
Much of this work was done by Thejaswi Puthraya as part of Google's Summer of Code project; much thanks to him for the work, and to them for the program. This is a backwards-incompatible change; see the upgrading guide in docs/ref/contrib/comments/upgrade.txt for instructions if you were using the old comments system. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8557 bcc190cf-cafb-0310-a4f2-bffc1f526a37
30 lines
1,003 B
Python
30 lines
1,003 B
Python
from django.conf import settings
|
|
from django.contrib import comments
|
|
from django.contrib.comments.models import Comment
|
|
from django.contrib.comments.forms import CommentForm
|
|
from regressiontests.comment_tests.tests import CommentTestCase
|
|
|
|
class CommentAppAPITests(CommentTestCase):
|
|
"""Tests for the "comment app" API"""
|
|
|
|
def testGetCommentApp(self):
|
|
self.assertEqual(comments.get_comment_app(), comments)
|
|
|
|
def testGetForm(self):
|
|
self.assertEqual(comments.get_form(), CommentForm)
|
|
|
|
def testGetFormTarget(self):
|
|
self.assertEqual(comments.get_form_target(), "/post/")
|
|
|
|
def testGetFlagURL(self):
|
|
c = Comment(id=12345)
|
|
self.assertEqual(comments.get_flag_url(c), "/flag/12345/")
|
|
|
|
def getGetDeleteURL(self):
|
|
c = Comment(id=12345)
|
|
self.assertEqual(comments.get_delete_url(c), "/delete/12345/")
|
|
|
|
def getGetApproveURL(self):
|
|
c = Comment(id=12345)
|
|
self.assertEqual(comments.get_approve_url(c), "/approve/12345/")
|
|
|