@@ -0,0 +1,688 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Aimport pytest%0Afrom telepathy.models import Thread%0Afrom users.models import User%0Afrom catalog.models import Course%0Aimport json%0A%0Apytestmark = pytest.mark.django_db%0A%0A%0Adef create_thread(name):%0A    course = Course.objects.create(slug='AAA-000')%0A    user = User.objects.create(netid='test_user')%0A    thread = Thread.objects.create(name=name, user=user, course=course)%0A%0A    return thread%0A%0A%0Adef test_page_no_none():%0A    thread = create_thread('coucou')%0A    assert thread.page_no is None%0A%0A%0Adef test_page_no():%0A    thread = create_thread('coucou')%0A    thread.placement = json.dumps(%7B'page-no': 100%7D)%0A    assert thread.page_no is 100%0A

Test thread model