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

Fixed tests that fail when Eloquent's "strict mode" is enabled. #1162

Closed
wants to merge 2 commits into from

Conversation

ash-jc-allen
Copy link

Hey! This PR makes some really small updates to the tests that are copied into fresh applications when installing Jetstream.

With the new "strict mode" changes in Eloquent, if you enable it in your application, some of the tests will fail because certain attributes don't exist on the model. All I'm doing in the tests is grabbing fresh versions of the models that were causing the errors so that the fields are available.

I'm not entirely sure if what I've done is correct, and if I might be covering up an underlying issue in the new "strict mode" code. If so, apologies, feel free to close this PR! 😄

@taylorotwell
Copy link
Member

taylorotwell commented Oct 14, 2022

@ash-jc-allen I think the "real" way to fix this would be to put current_team_id in the UserFactory so that it actually exists for new models in your application?

@ash-jc-allen ash-jc-allen deleted the fix/fix-tests branch October 15, 2022 12:40
@ash-jc-allen
Copy link
Author

@taylorotwell Yeah, I had a feeling that this might not have been the right approach to fix the issue. I'll bear this in mind and add the fields to my factories when I run into this issue in the future. Thanks! 😄

@heychazza
Copy link

@ash-jc-allen I think the "real" way to fix this would be to put current_team_id in the UserFactory so that it actually exists for new models in your application?

What do we set this to? I had the issue when setting strict mode, and wasn't sure how to fix.

CC: @taylorotwell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants