Python names.get_last_name() Examples
The following are 7
code examples of names.get_last_name().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
names
, or try the search function
.
Example #1
Source File: FileMapping.py From pyrdp with GNU General Public License v3.0 | 6 votes |
def generate(remotePath: Path, outDir: Path): localName = f"{names.get_first_name()}{names.get_last_name()}" creationTime = datetime.datetime.now() index = 2 suffix = "" while True: if not (outDir / f"{localName}{suffix}").exists(): break else: suffix = f"_{index}" index += 1 localName += suffix return FileMapping(remotePath, outDir / localName, creationTime, "")
Example #2
Source File: utils_tests.py From jorvik with GNU General Public License v3.0 | 6 votes |
def crea_sede(presidente=None, estensione=LOCALE, genitore=None, locazione=None): ESTENSIONE_DICT = dict(ESTENSIONE) locazione = locazione or crea_locazione() s = Sede( nome="Com. " + ESTENSIONE_DICT[estensione] + " " + names.get_last_name(), tipo=Sede.COMITATO, estensione=estensione, genitore=genitore, telefono='+3902020202', email='comitato@prova.it', codice_fiscale='01234567891', partita_iva='01234567891', locazione=locazione ) s.save() if presidente is not None: d = Delega( inizio="1980-12-10", persona=presidente, tipo=PRESIDENTE, oggetto=s ) d.save() return s
Example #3
Source File: test_signup.py From jorvik with GNU General Public License v3.0 | 6 votes |
def test_new_registered_gender_is_set(self): genere_list = ['M', 'F'] for genere in genere_list: nome = names.get_first_name() cognome = names.get_last_name() nascita = datetime(random.randint(1960, 1990), random.randint(1, 12), random.randint(1, 28)) p = Persona( nome=nome, cognome=cognome, data_nascita=nascita, codice_fiscale=codicefiscale.build(nome, cognome, nascita, genere, 'D969'), comune_nascita=random.sample(COMUNI.keys(), 1)[0], indirizzo_residenza='Via Prova, 34', comune_residenza=random.sample(COMUNI.keys(), 1)[0], provincia_residenza='EE', cap_residenza='00100',) p.save() self.assertEquals(p.genere_codice_fiscale, genere) self.assertEquals(p.genere, genere)
Example #4
Source File: gen_names.py From orcamentos with MIT License | 5 votes |
def gen_last_name(): return names.get_last_name()
Example #5
Source File: gen_names.py From orcamentos with MIT License | 5 votes |
def gen_last_name(): return names.get_last_name()
Example #6
Source File: utils_tests.py From jorvik with GNU General Public License v3.0 | 5 votes |
def codice_fiscale_persona(persona): from base.comuni import COMUNI try: codice_comune = COMUNI[persona.comune_nascita.lower()] except KeyError: codice_comune = 'D000' try: return build(persona.cognome, persona.nome, persona.data_nascita, persona.genere, codice_comune) except: # Dati personali imcompatibili per creare un codice fiscale corretto. return build(names.get_last_name(), names.get_first_name(), persona.data_nascita, persona.genere, codice_comune)
Example #7
Source File: utils_tests.py From jorvik with GNU General Public License v3.0 | 5 votes |
def crea_persona(nome=None, cognome=None): nome = names.get_first_name() if not nome else nome cognome = names.get_last_name() if not cognome else cognome p = Persona.objects.create( nome=nome, cognome=cognome, codice_fiscale=codice_fiscale(), data_nascita="{}-{}-{}".format(random.randint(1960, 1990), random.randint(1, 12), random.randint(1, 28)) ) p.refresh_from_db() return p