from app.models import Comment,User,Pitch
from app import db
import unittest

class CommentModelTest(unittest.TestCase):
    def setUp(self):
        self.user_James = User(username = 'James',password = 'potato', email = 'james@ms.com')
        self.new_pitch = Pitch(pitch_title='Test',pitch_content='Pitches test',category="competitor",upvotes=0,downvotes=0)
        self.new_comment = Comment(id=1,comment='Test comment',user=self.user_James,pitch=self.new_pitch)

    

    def test_check_instance_variables(self):
        self.assertEquals(self.new_comment.comment,'Test comment')
        self.assertEquals(self.new_comment.user,self.user_James)
        self.assertEquals(self.new_comment.pitch,self.new_pitch)



    # def tearDown(self):
    #     self.new_pitch.query.delete()
    #     self.user_James.query.delete()