Skip to content

Commit 8f732fa

Browse files
Linda Penglpatmo
Linda Peng
authored andcommitted
Started writing tests for the osprojects model
1 parent 649c0c1 commit 8f732fa

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

project/osprojects/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from tagging.managers import CustomTaggableManager
88
from tagging.models import CustomTag, TaggedItems
99

10+
1011
def get_sentinel_user():
1112
return get_user_model().objects.get_or_create(username='deleted')[0]
1213

project/osprojects/tests.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1-
from django.test import TestCase
1+
import pytest
2+
from .factories import OSProjectsFactory
23

3-
# Create your tests here.
4+
5+
@pytest.mark.django_db
6+
def test_osprojects_model():
7+
""" Test OSProjects model """
8+
# create OSProjects model instance
9+
osproject = OSProjectsFactory(title="Buddybot", guid="cc63f918-d515-11ea-956f-0242ac130002")
10+
assert osproject.title == "Buddybot"
11+
assert osproject.guid == "cc63f918-d515-11ea-956f-0242ac130002"

0 commit comments

Comments
 (0)