# Path: media_manager/models.py
# class Course(models.Model):
#     lti_context_id = models.CharField(max_length=128, null=True)
#     lti_tool_consumer_instance_guid = models.CharField(max_length=1024, null=True)
#     api_course_id = models.IntegerField(null=True)
#     created = models.DateTimeField(auto_now_add=True)
#     updated = models.DateTimeField(auto_now=True)
# 
#     class Meta(object):
#         verbose_name = 'course'
#         verbose_name_plural = 'courses'
#         unique_together = ("lti_context_id", "lti_tool_consumer_instance_guid")
# 
#     def __unicode__(self):
#         return "{0}".format(self.lti_context_id)
# 
# class CourseModule(models.Model):
#     course = models.ForeignKey('Course', on_delete=models.CASCADE)
#     lti_resource_link_id = models.CharField(max_length=1024, null=False)
#     lti_resource_link_title = models.CharField(max_length=4096, null=False, blank=True, default='')
#     api_collection_id = models.IntegerField(null=True)
#     created = models.DateTimeField(auto_now_add=True)
#     updated = models.DateTimeField(auto_now=True)
# 
#     class Meta(object):
#         verbose_name = 'module'
#         verbose_name_plural = 'module'
# 
#     def __unicode__(self):
#         return "{0}".format(self.lti_resource_link_title)
# 
#     def asData(self):
#         return {
#             "id": self.pk,
#             "collection_id": self.api_collection_id,
#             "resource_link_id": self.lti_resource_link_id,
#         }


from django.test import TestCase
from .models import Course, CourseModule
        """
        course = Course.objects.get(id=1)
        self.assertEqual(course.lti_context_id, LTI_CONTEXT_ID)
        self.assertEqual(course.lti_tool_consumer_instance_guid, LTI_TOOL_CONSUMER_INSTANCE_GUID)
        self.assertEqual(course.api_course_id, API_COURSE_ID)

# Test class for the "CourseModule" model
class CourseModuleModelTest(TestCase):

    def setUp(self):
        """
        Create a CourseModule object.
        """
        sample_course_obj = Course.objects.create(
            lti_context_id = LTI_CONTEXT_ID,
            lti_tool_consumer_instance_guid = LTI_TOOL_CONSUMER_INSTANCE_GUID,
            api_course_id = API_COURSE_ID
        )

        CourseModule.objects.create(
            course = sample_course_obj,
            lti_resource_link_id = LTI_RESOURCE_LINK_ID,
            lti_resource_link_title = LTI_RESOURCE_LINK_TITLE,
            api_collection_id = API_COURSE_ID
        )

    def test_creation_of_a_course_module(self):
        """
        Test the successful creation of a CourseModule object.
        """

# Path: media_manager/models.py
# class Course(models.Model):
#     lti_context_id = models.CharField(max_length=128, null=True)
#     lti_tool_consumer_instance_guid = models.CharField(max_length=1024, null=True)
#     api_course_id = models.IntegerField(null=True)
#     created = models.DateTimeField(auto_now_add=True)
#     updated = models.DateTimeField(auto_now=True)
# 
#     class Meta(object):
#         verbose_name = 'course'
#         verbose_name_plural = 'courses'
#         unique_together = ("lti_context_id", "lti_tool_consumer_instance_guid")
# 
#     def __unicode__(self):
#         return "{0}".format(self.lti_context_id)
# 
# class CourseModule(models.Model):
#     course = models.ForeignKey('Course', on_delete=models.CASCADE)
#     lti_resource_link_id = models.CharField(max_length=1024, null=False)
#     lti_resource_link_title = models.CharField(max_length=4096, null=False, blank=True, default='')
#     api_collection_id = models.IntegerField(null=True)
#     created = models.DateTimeField(auto_now_add=True)
#     updated = models.DateTimeField(auto_now=True)
# 
#     class Meta(object):
#         verbose_name = 'module'
#         verbose_name_plural = 'module'
# 
#     def __unicode__(self):
#         return "{0}".format(self.lti_resource_link_title)
# 
#     def asData(self):
#         return {
#             "id": self.pk,
#             "collection_id": self.api_collection_id,
#             "resource_link_id": self.lti_resource_link_id,
#         }


# Path: media_manager/tests.py
from django.test import TestCase
from .models import Course, CourseModule

        """
        course = Course.objects.get(id=1)
        self.assertEqual(course.lti_context_id, LTI_CONTEXT_ID)
        self.assertEqual(course.lti_tool_consumer_instance_guid, LTI_TOOL_CONSUMER_INSTANCE_GUID)
        self.assertEqual(course.api_course_id, API_COURSE_ID)

# Test class for the "CourseModule" model
class CourseModuleModelTest(TestCase):

    def setUp(self):
        """
        Create a CourseModule object.
        """
        sample_course_obj = Course.objects.create(
            lti_context_id = LTI_CONTEXT_ID,
            lti_tool_consumer_instance_guid = LTI_TOOL_CONSUMER_INSTANCE_GUID,
            api_course_id = API_COURSE_ID
        )

        CourseModule.objects.create(
            course = sample_course_obj,
            lti_resource_link_id = LTI_RESOURCE_LINK_ID,
            lti_resource_link_title = LTI_RESOURCE_LINK_TITLE,
            api_collection_id = API_COURSE_ID
        )

    def test_creation_of_a_course_module(self):
        """
        Test the successful creation of a CourseModule object.
        """

        course_module = CourseModule.objects.get(id=1)