Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation #4 not present in tests #4

Open
sheenasany opened this issue Apr 12, 2023 · 1 comment
Open

Validation #4 not present in tests #4

sheenasany opened this issue Apr 12, 2023 · 1 comment
Assignees
Labels
se curriculum Issue for lessons in the Software Engineering program

Comments

@sheenasany
Copy link

Canvas Link

https://learning.flatironschool.com/courses/6182/assignments/211188?module_item_id=486871

Concern

  1. All posts have a title.

Does not appear as a test that needs to be passed even though it's stated in the instructions that a validator must be created for all posts to have a title.

Additional Context

No response

Suggested Changes

Either remove this from the instructions, or include it in the tests.

@sheenasany sheenasany added the se curriculum Issue for lessons in the Software Engineering program label Apr 12, 2023
@pgill97 pgill97 self-assigned this Apr 12, 2023
@pgill97
Copy link
Contributor

pgill97 commented Apr 17, 2023

Hi @sheenasany , there is a test included for this.

def test_requires_title(self):
'''requires each post to have a title.'''
with app.app_context():
content_string = "This is content" * 150
post = Post(content=content_string, category='Non-Fiction')
with pytest.raises(IntegrityError):
db.session.add(post)
db.session.commit()
db.session.query(Post).delete()
db.session.commit()

They are supposed to use the nullable=False constraint here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
se curriculum Issue for lessons in the Software Engineering program
Projects
None yet
Development

No branches or pull requests

2 participants