20 lines
676 B
Python
20 lines
676 B
Python
"""
|
|
Unit tests for instructor.enrollment methods.
|
|
"""
|
|
|
|
from django.test import TestCase
|
|
|
|
from instructor.views.api import _split_input_list
|
|
|
|
|
|
class TestInstructorAPIHelpers(TestCase):
|
|
""" Test helpers for instructor.api """
|
|
def test_split_input_list(self):
|
|
strings = []
|
|
lists = []
|
|
strings.append("Lorem@ipsum.dolor, sit@amet.consectetur\nadipiscing@elit.Aenean\r convallis@at.lacus\r, ut@lacinia.Sed")
|
|
lists.append(['Lorem@ipsum.dolor', 'sit@amet.consectetur', 'adipiscing@elit.Aenean', 'convallis@at.lacus', 'ut@lacinia.Sed'])
|
|
|
|
for (stng, lst) in zip(strings, lists):
|
|
self.assertEqual(_split_input_list(stng), lst)
|