From e66f0b33c24c597f0bece0bb4cb1292a0c53f7a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Mart=C3=ADn?= Date: Mon, 13 Oct 2014 16:24:40 +0200 Subject: [PATCH] Adding tests to the new feature --- CHANGES.rst | 2 ++ example/example/app/tests.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index fffd027..4610648 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,9 +2,11 @@ ------------------ * Support to Django 1.7 (I'm sorry to the delay) +* Adding get_FIELD_list function * Thanks to: * `Hernil `_ * `Vasyl Stanislavchuk `_ + * `Litchfield `_ 0.1.2 (2014-04-04) ------------------ diff --git a/example/example/app/tests.py b/example/example/app/tests.py index a189f84..d986f96 100644 --- a/example/example/app/tests.py +++ b/example/example/app/tests.py @@ -40,7 +40,12 @@ class MultiSelectTestCase(TestCase): def test_object(self): book = Book.objects.get(id=1) self.assertEqual(book.get_tags_display(), 'Sex, Work, Happy') + self.assertEqual(book.get_tags_list(), ['Sex', 'Work', 'Happy']) self.assertEqual(book.get_categories_display(), 'Handbooks and manuals by discipline, Books of literary criticism, Books about literature') + self.assertEqual(book.get_categories_list(), ['Handbooks and manuals by discipline', 'Books of literary criticism', 'Books about literature']) + + self.assertEqual(book.get_tags_list(), book.get_tags_display().split(', ')) + self.assertEqual(book.get_categories_list(), book.get_categories_display().split(', ')) def test_validate(self): book = Book.objects.get(id=1)