def setUp(self):
        self.view = views.SubscriptionUpdateView()
        factory = RequestFactory()
        self.view.request = factory.get('/')
        self.user = mommy.make('accounts.User')
        self.group = mommy.make('groups.Group')
        self.user.add_to_group(self.group.pk)
        self.view.request.user = self.user
        self.view.kwargs = {'group_id': self.group.pk}
Setup the SubscriptionUpdateViewTest TestCase
dataset/ETHPy150Open ofa/connect/open_connect/notifications/tests/test_views.py/SubscriptionUpdateViewTest.setUp