-
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.
- Loading branch information
1 parent
93e3a18
commit 9d89615
Showing
9 changed files
with
1,204 additions
and
95 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,32 @@ | ||
# Generated by Django 5.0.3 on 2024-03-25 23:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Subscription", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=100)), | ||
("cpf", models.CharField(max_length=11)), | ||
("email", models.EmailField(max_length=254)), | ||
("phone", models.CharField(max_length=20)), | ||
("created_at", models.DateTimeField(auto_now_add=True)), | ||
], | ||
), | ||
] |
File renamed without changes.
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,9 @@ | ||
from django.db import models | ||
|
||
|
||
class Subscription(models.Model): | ||
name = models.CharField(max_length=100) | ||
cpf = models.CharField(max_length=11) | ||
email = models.EmailField() | ||
phone = models.CharField(max_length=20) | ||
created_at = models.DateTimeField(auto_now_add=True) |
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,22 @@ | ||
from datetime import datetime | ||
|
||
from django.test import TestCase | ||
from eventex.subscriptions.models import Subscription | ||
|
||
|
||
class SubscriptionModelTest(TestCase): | ||
def setUp(self): | ||
self.obj = Subscription( | ||
name='Matheus Lopes', | ||
cpf='12345678912', | ||
email='[email protected]', | ||
phone='11984028729' | ||
) | ||
self.obj.save() | ||
|
||
def test_create(self): | ||
self.assertTrue(Subscription.objects.exists()) | ||
|
||
def test_created_at(self): | ||
"""Subscription must have an auto created_at attr.""" | ||
self.assertIsInstance(self.obj.created_at, datetime) |
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