<commit_before>from time import sleep
from lettuce import *
from rapidsms.contrib.locations.models import *

from survey.features.page_objects.batches import BatchListPage, AddBatchPage, EditBatchPage, AssignQuestionToBatchPage
from survey.features.page_objects.question import BatchQuestionsListPage
from survey.investigator_configs import *
from survey.models import HouseholdMemberGroup, Survey
from survey.models.question import Question
from survey.models.batch import Batch, BatchLocationStatus


@step(u'And I have a batch')
def and_i_have_prime_locations(step):
    world.batch = Batch.objects.create(order = 1, name = "Batch A", description='description', survey=world.survey)

@step(u'And I have prime locations')
def and_i_have_prime_locations(step):
    district = LocationType.objects.create(name=PRIME_LOCATION_TYPE, slug=PRIME_LOCATION_TYPE)
    world.districts = (
            Location.objects.create(name="Kampala", type=district),
            Location.objects.create(name="Abim", type=district),
    )

@step(u'And I visit batches listing page')
def and_i_visit_batches_listing_page(step):
    world.page = BatchListPage(world.browser,world.survey)
    world.page.visit()

@step(u'And I visit the first batch listed')
def and_i_visit_the_first_batch_listed(step):
    world.page = world.page.visit_batch(world.batch)

@step(u'Then I should see all the prime locations with open close toggles')
def then_i_should_see_all_the_prime_locations_with_open_close_toggles(step):
    world.page.batch_closed_for_all_locations()

@step(u'When I open batch for a location')
def when_i_open_batch_for_a_location(step):
    world.page.open_batch_for(world.districts[1])

@step(u'Then I should see it is open for that location in db')
def then_i_should_see_it_is_open_for_that_location_in_db(step):
    assert BatchLocationStatus.objects.filter(location = world.districts[1]).count() == 1
    assert BatchLocationStatus.objects.filter(location = world.districts[0]).count() == 0<commit_msg>Brain/Andrew: Fixing defect - Save member object when registering households and member is female<commit_after>from time import sleep
from lettuce import *
from rapidsms.contrib.locations.models import *

from survey.features.page_objects.batches import BatchListPage, AddBatchPage, EditBatchPage, AssignQuestionToBatchPage
from survey.features.page_objects.question import BatchQuestionsListPage
from survey.investigator_configs import *
from survey.models import HouseholdMemberGroup, Survey
from survey.models.question import Question
from survey.models.batch import Batch, BatchLocationStatus


@step(u'And I have a batch')
def and_i_have_prime_locations(step):
    world.batch = Batch.objects.create(order = 1, name = "Batch A", description='description', survey=world.survey)

@step(u'And I have prime locations')
def and_i_have_prime_locations(step):
    district = LocationType.objects.create(name=PRIME_LOCATION_TYPE, slug=PRIME_LOCATION_TYPE)
    world.districts = (
            Location.objects.create(name="Kampala", type=district),
            Location.objects.create(name="Abim", type=district),
    )

@step(u'And I visit batches listing page')
def and_i_visit_batches_listing_page(step):
    world.page = BatchListPage(world.browser,world.survey)
    world.page.visit()

@step(u'And I visit the first batch listed')
def and_i_visit_the_first_batch_listed(step):
    world.page = world.page.visit_batch(world.batch)

@step(u'Then I should see all the prime locations with open close toggles')
def then_i_should_see_all_the_prime_locations_with_open_close_toggles(step):
    world.page.batch_closed_for_all_locations()

@step(u'When I open batch for a location')
def when_i_open_batch_for_a_location(step):
    world.page.open_batch_for(world.districts[1])

@step(u'Then I should see it is open for that location in db')
def then_i_should_see_it_is_open_for_that_location_in_db(step):
    assert BatchLocationStatus.objects.filter(location=world.districts[1]).count() == 1
    assert BatchLocationStatus.objects.filter(location=world.districts[0]).count() == 0
{'fraction_non_alphanumeric': 0.09267453294001966, 'fraction_numerical': 0.0029498525073746312, 'mean_word_length': 6.189045936395759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7224607', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1258, 'n_words': 283}