def setUp(self): self.user = UserFactory(first_name="Indicator", last_name="CreateTest", username="******") self.user.set_password('password') self.user.save() self.tola_user = TolaUserFactory(user=self.user) self.country = self.tola_user.country self.program = ProgramFactory(funding_status='Funded', reporting_period_start='2016-03-01', reporting_period_end='2020-05-01') self.program.country.add(self.country) self.program.save() self.indicator = IndicatorFactory( program=self.program, unit_of_measure_type=Indicator.NUMBER, is_cumulative=False, direction_of_change=Indicator.DIRECTION_OF_CHANGE_NONE, target_frequency=Indicator.ANNUAL) self.request_factory = RequestFactory() self.client = Client() self.client.login(username="******", password='******')
def setUpTestData(cls): super().setUpTestData() user = UserFactory(username="******") user.set_password("12345") user.save() cls.tola_user = TolaUserFactory(user=user)