def test_SC_no_umbrella(self, test_user): # Arrange # Act sc = SupplyChainFactory.build(gov_department=test_user.gov_department, supply_chain_umbrella=None) # Assert self.validate(sc, {}, objects_saved=1)
def test_archived_no_reason(self, test_user): # Arrange # Act sc = SupplyChainFactory.build( gov_department=test_user.gov_department, is_archived=True, ) # Assert self.validate(sc, {ArcReason: ERROR_MSGS[ArcReason]}, objects_saved=0)
def test_archived_SC(self, test_user): # Arrange # Act sc = SupplyChainFactory.build( gov_department=test_user.gov_department, is_archived=True, archived_reason="Hello World", ) # Assert self.validate(sc, {}, objects_saved=1)
def test_SC_with_umbrella(self, test_user): # Arrange umbrella = SupplyChainUmbrellaFactory.create( gov_department=test_user.gov_department) # Act sc = SupplyChainFactory.build(gov_department=test_user.gov_department, supply_chain_umbrella=umbrella) # Assert self.validate(sc, {}, objects_saved=1)
def test_SC_with_inv_umbrella(self, test_user): # Arrange dept = GovDepartmentFactory.create() umbrella = SupplyChainUmbrellaFactory.create(gov_department=dept) # Act sc = SupplyChainFactory.build(gov_department=test_user.gov_department, supply_chain_umbrella=umbrella) # Assert self.validate(sc, {SCUmbrella: ERROR_MSGS[SCUmbrella]}, objects_saved=0)