Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds some very simple tests :) #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions fars/booking/test_bookables.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from django.test import TestCase
from booking.models import Bookable

class BookableTestCase(TestCase):
def setUp(self):
pass
Comment on lines +5 to +6
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this redundant with only pass?


def test_create_plain_bookable_name(self):
"""Creating a plain bookable should create a simple bookable with default values and no extra features"""
b = Bookable.objects.create(name="Room A")
self.assertEqual(b.name, "Room A")

def test_create_plain_bookable_description(self):
"""Creating a plain bookable should create a simple bookable with default values and no extra features"""
b = Bookable.objects.create(name="Room A", description="A nice room")
self.assertEqual(b.description, "A nice room")

def test_create_plain_bookable_public(self):
"""Creating a plain bookable should create a simple bookable with default values and no extra features"""
Comment on lines +18 to +19
Copy link
Member

Choose a reason for hiding this comment

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

Could this be combined with test_create_plain_bookable_name? Otherwise the description could at least be updated.

b = Bookable.objects.create(name="Room A")
self.assertFalse(b.public)