Skip to content

Commit

Permalink
Merge pull request #264 from CodeForPhilly/fix/participant-query
Browse files Browse the repository at this point in the history
change query to "icontains" over "iexact"
  • Loading branch information
MikeyManoguerra authored Apr 12, 2020
2 parents ab34c6b + 6c898c3 commit 429c9d3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions core/participants/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ def get_queryset(self):
pp_id = self.request.query_params.get('pp_id', None)
queryset = Participant.objects.all()
if first_name is not None:
queryset = queryset.filter(first_name__iexact=first_name)
queryset = queryset.filter(first_name__icontains=first_name)
if last_name is not None:
queryset = queryset.filter(last_name__iexact=last_name)
queryset = queryset.filter(last_name__icontains=last_name)
if last_four_ssn is not None:
queryset = queryset.filter(last_four_ssn=last_four_ssn)
if dob is not None:
Expand Down
9 changes: 5 additions & 4 deletions frontend/test/Login.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe("<LoginForm />", () => {

it("should have the expected props on the username field", () => {
expect(usernameInput.props()).toEqual({
error: null,
id: "username",
name: "username",
value: "",
Expand All @@ -68,6 +69,7 @@ describe("<LoginForm />", () => {

it("should have the expected props on the password field", () => {
expect(passwordInput.props()).toEqual({
error: null,
id: "password",
name: "password",
value: "",
Expand All @@ -83,12 +85,11 @@ describe("<LoginForm />", () => {

it("should have the expected props on the button", () => {
expect(signInButton.props()).toEqual({
type: "button",
type: "submit",
variant: "contained",
style: expect.objectContaining({
style: {
marginTop: "10px",
}),
onClick: expect.any(Function),
},
children: "Sign In",
})
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/test/__snapshots__/Login.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<LoginForm /> Unit tests should match the snapshot 1`] = `"<div class=\\"login-form\\"><form class=\\"login-form__form\\"><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"username\\">Username</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"username\\" aria-invalid=\\"false\\" id=\\"username\\" name=\\"username\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"password\\">Password</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"password\\" aria-invalid=\\"false\\" id=\\"password\\" name=\\"password\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained\\" tabindex=\\"0\\" type=\\"button\\" style=\\"margin-top:10px\\"><span class=\\"MuiButton-label\\">Sign In</span></button></form></div>"`;
exports[`<LoginForm /> Unit tests should match the snapshot 1`] = `"<div class=\\"login-form\\"><form class=\\"login-form__form\\"><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"username\\">Username</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"username\\" id=\\"username\\" name=\\"username\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><div class=\\"MuiFormGroup-root login-form__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"password\\">Password</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\" required=\\"\\"><input type=\\"password\\" id=\\"password\\" name=\\"password\\" required=\\"\\" value=\\"\\" class=\\"MuiInputBase-input MuiInput-input\\"/></div></div></div><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained\\" tabindex=\\"0\\" type=\\"submit\\" style=\\"margin-top:10px\\"><span class=\\"MuiButton-label\\">Sign In</span></button></form></div>"`;
2 changes: 1 addition & 1 deletion frontend/test/__snapshots__/UserSearch.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<UserSearch /> should match the snapshot 1`] = `"<div class=\\"participant-search\\"><div align=\\"center\\"><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Participant Search</b></h5><p class=\\"MuiTypography-root participant-reminder MuiTypography-body2 MuiTypography-gutterBottom\\"><b>Reminder:</b> Search for participant profile prior to creating a new profile</p><form class=\\"participant-search__form\\"><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"user_id\\">User ID</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"user_id\\" name=\\"user_id\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Or</b></h5><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"first_name\\">First Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"first_name\\" name=\\"first_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"last_name\\">Last Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"last_name\\" name=\\"last_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><p class=\\"error-message\\"></p><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained\\" tabindex=\\"0\\" type=\\"submit\\" style=\\"margin-top: 30px;\\"><span class=\\"MuiButton-label\\">Submit</span><span class=\\"MuiTouchRipple-root\\"></span></button></form></div></div>"`;
exports[`<UserSearch /> should match the snapshot 1`] = `"<div class=\\"participant-search\\"><div align=\\"center\\"><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Participant Search</b></h5><p class=\\"MuiTypography-root participant-reminder MuiTypography-body2 MuiTypography-gutterBottom\\"><b>Reminder:</b> Search for participant profile prior to creating a new profile</p><form class=\\"participant-search__form\\"><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"user_id\\">User ID</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"user_id\\" name=\\"user_id\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><h5 class=\\"MuiTypography-root participant-head MuiTypography-h5 MuiTypography-gutterBottom\\"><b>Or</b></h5><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"first_name\\">First Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"first_name\\" name=\\"first_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><div class=\\"MuiFormGroup-root participant-search__input\\"><div class=\\"MuiFormControl-root\\"><label class=\\"MuiFormLabel-root MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated\\" data-shrink=\\"false\\" for=\\"last_name\\">Last Name</label><div class=\\"MuiInputBase-root MuiInput-root MuiInput-underline MuiInputBase-formControl MuiInput-formControl\\"><input aria-invalid=\\"false\\" id=\\"last_name\\" name=\\"last_name\\" type=\\"text\\" class=\\"MuiInputBase-input MuiInput-input\\" value=\\"\\"></div></div></div><p class=\\"error-message\\"></p><button class=\\"MuiButtonBase-root MuiButton-root MuiButton-contained Mui-disabled Mui-disabled\\" tabindex=\\"-1\\" type=\\"submit\\" disabled=\\"\\" style=\\"margin-top: 30px;\\"><span class=\\"MuiButton-label\\">Submit</span></button></form></div></div>"`;

0 comments on commit 429c9d3

Please sign in to comment.