def setUp(self):
        self.permissions = [Permission.objects.get(codename='delete_business')]
        self.user = factories.User(permissions=self.permissions)
        self.login_user(self.user)

        self.obj = factories.Business()

        self.url_kwargs = {'business_id': self.obj.pk}
Exemple #2
0
 def setUp(self):
     super(TestCreateProject, self).setUp()
     self.user = factories.User(permissions=self.permissions)
     self.login_user(self.user)
     self.post_data = {
         'name': 'Project',
         'business_1': factories.Business().pk,
         'point_person': factories.Superuser().pk,
         'activity_group': factories.ActivityGroup().pk,
         'type': factories.TypeAttribute().pk,
         'status': factories.StatusAttribute().pk,
         'description': 'a project...',
     }
    def setUp(self):
        self.permissions = [Permission.objects.get(codename='add_project')]
        self.user = factories.User(permissions=self.permissions)
        self.login_user(self.user)

        self.post_data = {
            'name': 'Project',
            'business_1': factories.Business().pk,
            'point_person': factories.Superuser().pk,
            'activity_group': factories.ActivityGroup().pk,
            'type': factories.TypeAttribute().pk,
            'status': factories.StatusAttribute().pk,
            'description': 'a project...',
        }
 def test_search_business(self):
     business = factories.Business()
     response = self._post(data={
         'quick_search_1': 'business-{0}'.format(business.pk),
     })
     self.assertRedirectsNoFollow(response, business.get_absolute_url())