Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Conversation

@lqlin33
Copy link

@lqlin33 lqlin33 commented Apr 2, 2019

Changes made:

  • Basic unit tests for petition, user, and response models
  • Tested setter functions even if setter functions aren't necessary in model (can be removed later)

These changes will resolve #27.

Changes not made:

  • Checking code coverage, this functionality can be easily tacked on later

Current unit tests are based very closely off the current model, so drastic changes in the model may require a restructuring of the unit tests.

Copy link
Contributor

@garoller garoller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests look good, I just imported the wrong thing when I initially made the tests.py file, so some small changes have to be made.

Thank you!

index/tests.py Outdated
@@ -1,23 +1,170 @@
import unittest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change this to from django.test import TestCase. I included this in the initial commit of this file, so I'm sorry about that. See the docs for details.

index/tests.py Outdated
# check code coverage


class PetitionModelTestCase(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change unittest.TestCase to TestCase

index/tests.py Outdated
self.assertFalse(p.check_tags())


class UserModelTestCase(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change unittest.TestCase to TestCase

index/tests.py Outdated
self.assertTrue(u.admin)


class ResponseModelTestCase(unittest.TestCase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change unittest.TestCase to TestCase

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Write model unit tests

3 participants