forked from Decide-Part-Rota/decide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request EGCETSII#27 from Decide-Part-Rota/Rota3-005
feat: added discord_account field on Person model, it has a regex val…
- Loading branch information
Showing
5 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
decide/authentication/migrations/0007_person_discord_account.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.0 on 2022-12-14 22:06 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('authentication', '0006_auto_20221202_0115'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='person', | ||
name='discord_account', | ||
field=models.CharField(blank=True, max_length=30), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from django.test import TestCase | ||
from django.contrib.staticfiles.testing import StaticLiveServerTestCase | ||
from selenium import webdriver | ||
from base.tests import BaseTestCase | ||
from selenium.webdriver.common.by import By | ||
from django.contrib.auth.models import User | ||
|
||
class testRegistro(StaticLiveServerTestCase): | ||
def setUp(self): | ||
#Load base test functionality for decide | ||
self.base = BaseTestCase() | ||
self.base.setUp() | ||
|
||
options = webdriver.ChromeOptions() | ||
options.headless = True | ||
self.driver = webdriver.Chrome(options=options) | ||
|
||
def tearDown(self): | ||
super().tearDown() | ||
self.driver.quit() | ||
self.base.tearDown() | ||
|
||
def testRegistroCorrecto(self): | ||
#Crear server | ||
self.driver.get(f'{self.live_server_url}') | ||
self.driver.set_window_size(1366, 728) | ||
|
||
#Clickar en registrarse | ||
self.driver.find_element(By.LINK_TEXT, "Registrarse").click() | ||
|
||
#Rellenar los campos | ||
self.driver.find_element(By.ID, "id_username").send_keys("Voter1") | ||
self.driver.find_element(By.ID, "id_password1").send_keys("Password 1") | ||
self.driver.find_element(By.ID, "id_password2").send_keys("Password 1") | ||
self.driver.find_element(By.ID, "id_email").send_keys("[email protected]") | ||
self.driver.find_element(By.ID, "id_age").send_keys("18") | ||
self.driver.find_element(By.ID, "id_country").send_keys("Spain") | ||
self.driver.find_element(By.XPATH, "/html/body/div/form/button").click() | ||
|
||
#Comprobar redireccion y existencia del perfil | ||
assert self.driver.find_element(By.LINK_TEXT, "Registrarse").text == 'Registrarse' | ||
assert User.objects.get(username='Voter1').email == '[email protected]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters