def create_facility(health_facility): fetcher = FredFacilitiesFetcher(FredConfig.get_settings()) facility = {'name': health_facility.name, 'active': True, 'coordinates': [0,0] } return fetcher.create_facility_in_provider(facility)
def send_facility_update(health_facility): fetcher = FredFacilitiesFetcher(FredConfig.get_settings()) facility = {'name': health_facility.name, 'active': health_facility.active} return fetcher.update_facilities_in_provider(health_facility.uuid, facility)
import json from lettuce import * from lxml import html from random import randint from nose.tools import assert_equals from splinter import Browser from lettuce.django import django_url from healthmodels.models.HealthFacility import * import reversion from reversion.models import Revision from fred_consumer.models import FredConfig, HealthFacilityIdMap,Failure from django.db import transaction from fred_consumer.fred_connect import FredFacilitiesFetcher from time import sleep FRED_CONFIG = FredConfig.get_settings() NO_OF_EXISTING_FAILURE = len(Failure.objects.all()) RANDOM_FACILTY_NAME = "TW"+ str(randint(1,9999)) @transaction.commit_on_success def create_facility(f): f.save(False) return f @before.each_scenario def set_browser(scenario): world.browser = Browser() world.uuid = None def destroy_data_with_uuid(uuid):