def createOrganization(self, date, name, parentId): organization = Organization( created_at = date, updated_at = date, name = name, classification = 'goverment', parent_id = parentId, description = '', summary = '', area_id = self.argentinaCache.id ) organization.save() organizationExtra = OrganizationExtra( register = '', base_id = organization.id, slug = 'goverment:' + str(organization.id) ) organizationExtra.save() return organization
def test_it_copies_the_dissolution_date_to_end_date(self): o = Organization(name=faker.company(), dissolution_date=faker.year()) # it is not set to start_date until saved self.assertIsNone(o.end_date) o.save() self.assertEqual(o.end_date, o.dissolution_date)
def test_it_copies_the_foundation_date_to_start_date(self): o = Organization(name=faker.company(), founding_date=faker.year()) # it is not set to start_date until saved self.assertIsNone(o.start_date) o.save() self.assertEqual(o.start_date, o.founding_date)
def test_it_copies_the_dissolution_date_to_end_date(self): o = Organization(name=unicode(faker.company()), dissolution_date=unicode(faker.year())) #it is not set to start_date until saved self.assertIsNone(o.end_date) o.save() self.assertEqual(o.end_date, o.dissolution_date)