Commit 025a573e by Jacek Tomaszewski

Add related attribute test.

parent 056afc30
......@@ -287,6 +287,13 @@ class TaggableManagerTestCase(BaseTaggingTestCase):
["hd"],
)
def test_field_api(self):
# Check if tag field, which simulates m2m, has django-like api.
field = self.food_model._meta.get_field('tags')
self.assertTrue(hasattr(field, 'rel'))
self.assertTrue(hasattr(field, 'related'))
self.assertEqual(self.food_model, field.related.model)
class TaggableManagerDirectTestCase(TaggableManagerTestCase):
food_model = DirectFood
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment