def test_post_slugify(self): '''This test creates a :class:`~papers.models.Post` and then verifies the unicode representation is correct.''' test_post = Post(post_title="Test Post", author = Person.objects.get(pk=1), markdown_url = 'https://raw.githubusercontent.com/BridgesLab/Lab-Website/master/LICENSE.md') test_post.save() self.assertEqual(test_post.post_slug, "test-post")
def test_create_new_post_minimum(self): '''This test creates a :class:`~papers.models.Post` with the required information only.''' test_post = Post(post_title="Test Post", author = Person.objects.get(pk=1), markdown_url = 'https://raw.githubusercontent.com/BridgesLab/Lab-Website/master/LICENSE.md') test_post.save() self.assertEqual(test_post.pk, 1)
def test_create_new_post_all(self): '''This test creates a :class:`~papers.models.Post` with all fields entered.''' test_post = Post(post_title="Test Post", author = Person.objects.get(pk=1), markdown_url = 'https://raw.githubusercontent.com/BridgesLab/Lab-Website/master/LICENSE.md', paper = Publication.objects.get(pk=1), project = Project.objects.get(pk=1)) test_post.save() self.assertEqual(test_post.pk, 1)
def test_post_slugify(self): '''This test creates a :class:`~papers.models.Post` and then verifies the unicode representation is correct.''' test_post = Post( post_title="Test Post", author=Person.objects.get(pk=1), markdown_url= 'https://raw.githubusercontent.com/BridgesLab/Lab-Website/master/LICENSE.md' ) test_post.save() self.assertEqual(test_post.post_slug, "test-post")
def test_create_new_post_minimum(self): '''This test creates a :class:`~papers.models.Post` with the required information only.''' test_post = Post( post_title="Test Post", author=Person.objects.get(pk=1), markdown_url= 'https://raw.githubusercontent.com/BridgesLab/Lab-Website/master/LICENSE.md' ) test_post.save() self.assertEqual(test_post.pk, 1)
def test_create_new_post_all(self): '''This test creates a :class:`~papers.models.Post` with all fields entered.''' test_post = Post( post_title="Test Post", author=Person.objects.get(pk=1), markdown_url= 'https://raw.githubusercontent.com/BridgesLab/Lab-Website/master/LICENSE.md', paper=Publication.objects.get(pk=1), project=Project.objects.get(pk=1)) test_post.save() self.assertEqual(test_post.pk, 1)