Esempio n. 1
0
 def test_required_form_fields(self):
     user = core_fact.create_user()
     payload = {}
     form = ProformaEditForm(current_user=user, data=payload)
     self.assertFalse(form.is_valid())
     self.assertTrue(form.has_error('date_fa'))
     self.assertTrue(form.has_error('exp_date_fa'))
Esempio n. 2
0
 def setUp(self) -> None:
     self.user = core_factories.create_user(username='******')
     self.unit_choices = [
         ('kg', _('kg')),
         ('machine', _('machine')),
         ('item', _('item')),
         ('count', _('count')),
     ]
Esempio n. 3
0
    def setUp(self):
        super().setUp()
        self.client_anon = APIClient()
        self.user = core_factories.create_user(username='******')
        self.client.force_authenticate(user=self.user)

        self.client_exp = APIClient()
        self.ex_user = core_factories.create_user(username='******', last_name='expert_user')
        self.ex_user = core_factories.add_user_to_groupe(self.ex_user)
        self.client_exp.force_authenticate(user=self.ex_user)

        self.client_superuser = APIClient()
        self.superuser = core_factories.create_user(username='******')
        self.superuser = core_factories.add_user_to_groupe(self.superuser)
        self.client_superuser.force_authenticate(user=self.superuser)

        result = factories.create_payload(owner=self.ex_user)
        self.payload = result['payload']
        self.sample_cost = result['pc']
Esempio n. 4
0
 def setUp(self) -> None:
     core_fact.create_exp_group_with_perms()
     self.user = core_fact.create_user(username='******')
     self.ex_user = core_fact.create_exp_user(username='******')
     self.superuser = core_fact.create_super_user(username='******')
     self.order = req_fact.RequestFactory.create(owner=self.ex_user)
     self.part_data = {
         'req': self.order,
         'title': 'flange',
         'qty': 10,
         'code': 123
     }
Esempio n. 5
0
 def setUp(self) -> None:
     self.user = core_factories.create_user()
     self.ex_user = core_factories.create_exp_user(username='******')
Esempio n. 6
0
 def setUp(self):
     self.user = core_factories.create_user(username='******')
     self.exp_user = core_factories.create_exp_user(username='******')
     self.superuser = core_factories.create_user(username='******')
Esempio n. 7
0
 def prepare_test_setup(self):
     core_fact.create_exp_group_with_perms()
     self.user = core_fact.create_user(username='******')
     self.exp_user = core_fact.create_exp_user(username='******')
     self.super_user = core_fact.create_super_user(username='******')
Esempio n. 8
0
 def setUp(self) -> None:
     self.user = core_fact.create_user(username='******')
     self.ex_user = core_fact.create_user(username='******')