# Path: app_forum/models.py
# class Forum(models.Model):
#     """
#     Thread Model
#     """
# 
#     class Meta:
#         verbose_name_plural = "Title"
# 
#     forum_author = models.ForeignKey(
#         Profile,
#         related_name='user_forums',
#         null=True,
#         blank=True,
#         on_delete=models.CASCADE
#     )
# 
#     forum_title = models.CharField(
#         max_length=225,
#         verbose_name=u'Title',
#         blank=False,
#         null=False
#     )
# 
#     forum_category = models.ForeignKey(
#         'Category',
#         on_delete=models.CASCADE,
#         verbose_name=u'Category',
#     )
# 
#     forum_content = MarkdownxField(
#         verbose_name=u'Content (Use Markdown)',
#     )
# 
#     is_created = models.DateTimeField(
#         auto_now_add=True,
#         null=True,
#         blank=True
#     )
# 
#     is_modified = models.DateTimeField(
#         auto_now=True,
#         null=True,
#         blank=True
#     )
# 
#     is_hot = models.BooleanField(
#         default=False
#     )
# 
#     is_closed = models.BooleanField(
#         default=False
#     )
# 
#     def __str__(self):
#         return str(self.forum_title)
# 
#     def latest_comment_author(self):
#         return self.forum_comments.latest('is_created').comment_author
# 
#     def latest_comment_date(self):
#         return self.forum_comments.latest('is_created').is_created
# 
#     def get_absolute_url(self):
#         """
#         Call Forum ID
#         """
#         return 'app_forum:forum'
# 
# class Comment(models.Model):
#     """
#     Comment Model
#     """
# 
#     class Meta:
#         verbose_name_plural = "Comment"
#         
#     forum = models.ForeignKey(
#         'Forum',
#         on_delete=models.CASCADE,
#         related_name='forum_comments'
#     )
# 
#     comment_author = models.ForeignKey(
#         Profile,
#         related_name='user_comments',
#         null=True,
#         blank=True,
#         on_delete=models.CASCADE
#     )
# 
#     comment_content = MarkdownxField(
#         verbose_name=u'Markdown',
#     )
# 
#     is_created = models.DateTimeField(
#         auto_now_add=True,
#     )
# 
#     is_modified = models.DateTimeField(
#         auto_now=True,
#     )
# 
#     def __str__(self):
#         return self.comment_content
# 
# Path: app_forum/forms.py
# class CommentForm(forms.ModelForm):
#     """
#     Comment Form
#     """
#     class Meta:
#         model = Comment
#         fields = (
#             'comment_content',
#         )
#         comment_content = MarkdownxFormField()
#         exclude = ['comment_author']
#         widgets = {'comment_author': forms.HiddenInput()}
# 
# class ThreadForm(forms.ModelForm):
#     """
#     Comment Form
#     """
#     class Meta:
#         model = Forum
#         fields = (
#             'forum_title',
#             'forum_category',
#             'forum_content',
#         )
#         comment_content = MarkdownxFormField()
#         exclude = ['forum_author', 'is_hot']
#         widgets = {'forum_author': forms.HiddenInput()}


from django.test import TestCase
from app_forum.models import Forum, Comment
from app_forum.forms import CommentForm, ThreadForm

# test for forms

class CommentFormTest(TestCase):

    def test_comment_forms(self):
        form_data = {
            'comment_content' : 'comment'
        }

# Path: app_forum/models.py
# class Forum(models.Model):
#     """
#     Thread Model
#     """
# 
#     class Meta:
#         verbose_name_plural = "Title"
# 
#     forum_author = models.ForeignKey(
#         Profile,
#         related_name='user_forums',
#         null=True,
#         blank=True,
#         on_delete=models.CASCADE
#     )
# 
#     forum_title = models.CharField(
#         max_length=225,
#         verbose_name=u'Title',
#         blank=False,
#         null=False
#     )
# 
#     forum_category = models.ForeignKey(
#         'Category',
#         on_delete=models.CASCADE,
#         verbose_name=u'Category',
#     )
# 
#     forum_content = MarkdownxField(
#         verbose_name=u'Content (Use Markdown)',
#     )
# 
#     is_created = models.DateTimeField(
#         auto_now_add=True,
#         null=True,
#         blank=True
#     )
# 
#     is_modified = models.DateTimeField(
#         auto_now=True,
#         null=True,
#         blank=True
#     )
# 
#     is_hot = models.BooleanField(
#         default=False
#     )
# 
#     is_closed = models.BooleanField(
#         default=False
#     )
# 
#     def __str__(self):
#         return str(self.forum_title)
# 
#     def latest_comment_author(self):
#         return self.forum_comments.latest('is_created').comment_author
# 
#     def latest_comment_date(self):
#         return self.forum_comments.latest('is_created').is_created
# 
#     def get_absolute_url(self):
#         """
#         Call Forum ID
#         """
#         return 'app_forum:forum'
# 
# class Comment(models.Model):
#     """
#     Comment Model
#     """
# 
#     class Meta:
#         verbose_name_plural = "Comment"
#         
#     forum = models.ForeignKey(
#         'Forum',
#         on_delete=models.CASCADE,
#         related_name='forum_comments'
#     )
# 
#     comment_author = models.ForeignKey(
#         Profile,
#         related_name='user_comments',
#         null=True,
#         blank=True,
#         on_delete=models.CASCADE
#     )
# 
#     comment_content = MarkdownxField(
#         verbose_name=u'Markdown',
#     )
# 
#     is_created = models.DateTimeField(
#         auto_now_add=True,
#     )
# 
#     is_modified = models.DateTimeField(
#         auto_now=True,
#     )
# 
#     def __str__(self):
#         return self.comment_content
# 
# Path: app_forum/forms.py
# class CommentForm(forms.ModelForm):
#     """
#     Comment Form
#     """
#     class Meta:
#         model = Comment
#         fields = (
#             'comment_content',
#         )
#         comment_content = MarkdownxFormField()
#         exclude = ['comment_author']
#         widgets = {'comment_author': forms.HiddenInput()}
# 
# class ThreadForm(forms.ModelForm):
#     """
#     Comment Form
#     """
#     class Meta:
#         model = Forum
#         fields = (
#             'forum_title',
#             'forum_category',
#             'forum_content',
#         )
#         comment_content = MarkdownxFormField()
#         exclude = ['forum_author', 'is_hot']
#         widgets = {'forum_author': forms.HiddenInput()}


# Path: app_forum/tests/test_forms.py
from django.test import TestCase
from app_forum.models import Forum, Comment
from app_forum.forms import CommentForm, ThreadForm


# test for forms

class CommentFormTest(TestCase):

    def test_comment_forms(self):
        form_data = {
            'comment_content' : 'comment'
        }

        form = CommentForm(data=form_data)