| Total Complexity | 4 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | from django.test.utils import override_settings |
||
| 10 | @override_settings( |
||
| 11 | ACTSTREAM_ACTION_MODEL='custom.CustomAction', |
||
| 12 | ACTSTREAM_FOLLOW_MODEL='custom.CustomFollow' |
||
| 13 | ) |
||
| 14 | class CustomModelTests(ActivityBaseTestCase): |
||
| 15 | def setUp(self): |
||
| 16 | super(CustomModelTests, self).setUp() |
||
| 17 | self.user = self.User.objects.create(username='test') |
||
| 18 | |||
| 19 | def test_custom_action_model(self): |
||
| 20 | self.assertEqual(get_action_model(), CustomAction) |
||
| 21 | |||
| 22 | def test_custom_follow_model(self): |
||
| 23 | self.assertEqual(get_follow_model(), CustomFollow) |
||
| 24 | |||
| 25 | def test_custom_data(self): |
||
| 26 | """Adding custom data to a model field works as expected.""" |
||
| 27 | action.send(self.user, verb='was created', quest='to be awesome') |
||
| 28 | self.assertEqual(CustomAction.objects.count(), 1) |
||
| 29 | self.assertEqual(CustomAction.objects.first().quest, 'to be awesome') |
||
| 30 |