-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test added and model added for bucketList
- Loading branch information
Showing
8 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+183 Bytes
medicine_reminder/api/migrations/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
from django.db import models | ||
|
||
# Create your models here. | ||
class Bucketlist(models.Model): | ||
"""This class represnts the bucketlist model""" | ||
name = models.CharField(max_length=225, blank=False, unique=True) | ||
date_created = models.DateTimeField(auto_now_add=True) | ||
date_modified = models.DateTimeField(auto_now=True) | ||
|
||
def __str__(self): | ||
"""return a human readable represntation o"f the model in instance""" | ||
return "{}".format(self.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,19 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. | ||
from .models import Bucketlist | ||
|
||
class ModelTestCase(TestCase): | ||
"""This class defines the test suite for the bucketlist model.""" | ||
|
||
def setUp(self): | ||
"""Define the test client and other test variables.""" | ||
self.bucketlist_name = "Write world class code" | ||
self.bucketlist = Bucketlist(name=self.bucketlist_name) | ||
|
||
def test_model_can_create_a_bucketlist(self): | ||
"""Test the bucketlist model can create a bucketlist.""" | ||
old_count = Bucketlist.objects.count() | ||
self.bucketlist.save() | ||
new_count = Bucketlist.objects.count() | ||
self.assertNotEqual(old_count, new_count) |
Binary file modified
BIN
+9 Bytes
(100%)
medicine_reminder/medicine_reminder/__pycache__/settings.cpython-36.pyc
Binary file not shown.