mirror of https://github.com/snachodog/mybuddy.git
Fix tests
This commit is contained in:
parent
bd78149db3
commit
e5279f2d7a
|
@ -132,7 +132,7 @@ class NoteSerializer(TaggitSerializer, CoreModelSerializer):
|
|||
model = models.Note
|
||||
fields = ("id", "child", "note", "time", "tags")
|
||||
|
||||
tags = TagListSerializerField()
|
||||
tags = TagListSerializerField(required=False)
|
||||
|
||||
|
||||
class SleepSerializer(CoreModelWithDurationSerializer):
|
||||
|
|
|
@ -251,13 +251,14 @@ class NoteAPITestCase(TestBase.BabyBuddyAPITestCaseBase):
|
|||
def test_get(self):
|
||||
response = self.client.get(self.endpoint)
|
||||
self.assertEqual(response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(
|
||||
self.assertDictEqual(
|
||||
response.data["results"][0],
|
||||
{
|
||||
"id": 1,
|
||||
"child": 1,
|
||||
"note": "Fake note.",
|
||||
"time": "2017-11-17T22:45:00-05:00",
|
||||
"tags": [],
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ from django.core.validators import RegexValidator
|
|||
|
||||
import random
|
||||
|
||||
from taggit.managers import TaggableManager
|
||||
from taggit.models import TagBase, GenericTaggedItemBase, TaggedItemBase
|
||||
from taggit.managers import TaggableManager as TaggitTaggableManager
|
||||
from taggit.models import TagBase, GenericTaggedItemBase
|
||||
|
||||
random.seed()
|
||||
|
||||
|
@ -135,7 +135,7 @@ class Tagged(GenericTaggedItemBase):
|
|||
return super().save_base(*args, **kwargs)
|
||||
|
||||
|
||||
class TaggableManager(TaggableManager):
|
||||
class TaggableManager(TaggitTaggableManager):
|
||||
"""
|
||||
Remove default help_text - only reason for this to exist.
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue