diff options
Diffstat (limited to 'tests/comment_tests/custom_comments')
| -rw-r--r-- | tests/comment_tests/custom_comments/__init__.py | 32 | ||||
| -rw-r--r-- | tests/comment_tests/custom_comments/forms.py | 5 | ||||
| -rw-r--r-- | tests/comment_tests/custom_comments/models.py | 5 | ||||
| -rw-r--r-- | tests/comment_tests/custom_comments/views.py | 14 |
4 files changed, 56 insertions, 0 deletions
diff --git a/tests/comment_tests/custom_comments/__init__.py b/tests/comment_tests/custom_comments/__init__.py new file mode 100644 index 0000000000..598927eace --- /dev/null +++ b/tests/comment_tests/custom_comments/__init__.py @@ -0,0 +1,32 @@ +from django.core import urlresolvers +from regressiontests.comment_tests.custom_comments.models import CustomComment +from regressiontests.comment_tests.custom_comments.forms import CustomCommentForm + +def get_model(): + return CustomComment + +def get_form(): + return CustomCommentForm + +def get_form_target(): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_submit_comment" + ) + +def get_flag_url(c): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_flag_comment", + args=(c.id,) + ) + +def get_delete_url(c): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_delete_comment", + args=(c.id,) + ) + +def get_approve_url(c): + return urlresolvers.reverse( + "regressiontests.comment_tests.custom_comments.views.custom_approve_comment", + args=(c.id,) + ) diff --git a/tests/comment_tests/custom_comments/forms.py b/tests/comment_tests/custom_comments/forms.py new file mode 100644 index 0000000000..07918ddb8c --- /dev/null +++ b/tests/comment_tests/custom_comments/forms.py @@ -0,0 +1,5 @@ +from django import forms + + +class CustomCommentForm(forms.Form): + pass diff --git a/tests/comment_tests/custom_comments/models.py b/tests/comment_tests/custom_comments/models.py new file mode 100644 index 0000000000..646f6255f2 --- /dev/null +++ b/tests/comment_tests/custom_comments/models.py @@ -0,0 +1,5 @@ +from django.db import models + + +class CustomComment(models.Model): + pass diff --git a/tests/comment_tests/custom_comments/views.py b/tests/comment_tests/custom_comments/views.py new file mode 100644 index 0000000000..1c3a974367 --- /dev/null +++ b/tests/comment_tests/custom_comments/views.py @@ -0,0 +1,14 @@ +from django.http import HttpResponse + + +def custom_submit_comment(request): + return HttpResponse("Hello from the custom submit comment view.") + +def custom_flag_comment(request, comment_id): + return HttpResponse("Hello from the custom flag view.") + +def custom_delete_comment(request, comment_id): + return HttpResponse("Hello from the custom delete view.") + +def custom_approve_comment(request, comment_id): + return HttpResponse("Hello from the custom approve view.") |
