def setUp(self): self.database = FakeCouchDb() self.case_orig_db = CommCareCase.get_db() self.form_orig_db = XFormInstance.get_db() self.user_orig_db = CommCareUser.get_db() CommCareCase.set_db(self.database) XFormInstance.set_db(self.database) CommCareUser.set_db(self.database)
def setUp(self): self.database = FakeCouchDb() self.user_orig_db = CommCareUser.get_db() CommCareUser.set_db(self.database) self.factory = RequestFactory() domain = Domain.get_or_create_with_name(DOMAIN) domain.is_active = True domain.save() self.domain = domain user = WebUser.get_by_username('test') if not user: user = WebUser.create(domain.name, 'test', 'passwordtest', None, None) user.is_authenticated = True user.is_superuser = True user.is_authenticated = True user.is_active = True self.user = user
def setUp(self): self.database = FakeCouchDb() self.case_orig_db = CommCareCase.get_db() self.form_orig_db = XFormInstance.get_db() self.user_orig_db = CommCareUser.get_db() CommCareCase.set_db(self.database) XFormInstance.set_db(self.database) CommCareUser.set_db(self.database) self.factory = RequestFactory() domain = Domain.get_or_create_with_name('up-nrhm') domain.is_active = True domain.save() self.domain = domain user = WebUser.get_by_username('test') if not user: user = WebUser.create(domain.name, 'test', 'passwordtest') user.is_authenticated = True user.is_superuser = True user.is_authenticated = True user.is_active = True self.user = user
def tearDown(self): CommCareCase.set_db(self.case_orig_db) XFormInstance.set_db(self.form_orig_db) CommCareUser.set_db(self.user_orig_db)
def tearDown(self): CommCareUser.set_db(self.user_orig_db)