mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
Make email and notes required, fix unit test
This commit is contained in:
parent
784b187b09
commit
8570a03600
3 changed files with 7 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
# Generated by Django 4.2.7 on 2024-01-23 21:02
|
# Generated by Django 4.2.7 on 2024-01-23 23:51
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
@ -17,8 +17,8 @@ class Migration(migrations.Migration):
|
||||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||||
("updated_at", models.DateTimeField(auto_now=True)),
|
("updated_at", models.DateTimeField(auto_now=True)),
|
||||||
("email", models.EmailField(blank=True, db_index=True, help_text="Email", max_length=254)),
|
("email", models.EmailField(db_index=True, help_text="Email", max_length=254)),
|
||||||
("notes", models.TextField(blank=True, help_text="Notes")),
|
("notes", models.TextField(help_text="Notes")),
|
||||||
(
|
(
|
||||||
"requestor",
|
"requestor",
|
||||||
models.ForeignKey(
|
models.ForeignKey(
|
||||||
|
|
|
@ -9,7 +9,7 @@ class VeryImportantPerson(TimeStampedModel):
|
||||||
|
|
||||||
email = models.EmailField(
|
email = models.EmailField(
|
||||||
null=False,
|
null=False,
|
||||||
blank=True,
|
blank=False,
|
||||||
help_text="Email",
|
help_text="Email",
|
||||||
db_index=True,
|
db_index=True,
|
||||||
)
|
)
|
||||||
|
@ -24,7 +24,7 @@ class VeryImportantPerson(TimeStampedModel):
|
||||||
|
|
||||||
notes = models.TextField(
|
notes = models.TextField(
|
||||||
null=False,
|
null=False,
|
||||||
blank=True,
|
blank=False,
|
||||||
help_text="Notes",
|
help_text="Notes",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1748,7 +1748,7 @@ class VeryImportantPersonAdminTestCase(TestCase):
|
||||||
|
|
||||||
def test_save_model_sets_user_field(self):
|
def test_save_model_sets_user_field(self):
|
||||||
self.client.force_login(self.superuser)
|
self.client.force_login(self.superuser)
|
||||||
|
|
||||||
# Create an instance of the admin class
|
# Create an instance of the admin class
|
||||||
admin_instance = VeryImportantPersonAdmin(model=VeryImportantPerson, admin_site=None)
|
admin_instance = VeryImportantPersonAdmin(model=VeryImportantPerson, admin_site=None)
|
||||||
|
|
||||||
|
@ -1757,7 +1757,7 @@ class VeryImportantPersonAdminTestCase(TestCase):
|
||||||
|
|
||||||
# Create a request object
|
# Create a request object
|
||||||
request = self.factory.post("/admin/yourapp/veryimportantperson/add/")
|
request = self.factory.post("/admin/yourapp/veryimportantperson/add/")
|
||||||
request.requestor = self.superuser
|
request.user = self.superuser
|
||||||
|
|
||||||
# Call the save_model method
|
# Call the save_model method
|
||||||
admin_instance.save_model(request, vip_instance, None, None)
|
admin_instance.save_model(request, vip_instance, None, None)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue