Skip to content

Commit

Permalink
All backend tests should pass
Browse files Browse the repository at this point in the history
  • Loading branch information
akoser1 committed Jul 25, 2024
1 parent 757cd5d commit e9e309b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
3 changes: 2 additions & 1 deletion JP_Django/JP_Django/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4197,7 +4197,8 @@ class UpdateStreakTestCase(TestCase):
'content_type': 'text',
'content': None, #fill in with example entry
'text_entry': "This is a sample checkin text",
'date': datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S')
'date': datetime.datetime.today().strftime('%Y-%m-%d %H:%M:%S'),
'privacy': False
}

checkin_id=-1
Expand Down
15 changes: 0 additions & 15 deletions JP_Django/JP_Django/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,13 +710,6 @@ def validate_content_and_text_entry(data, checkin):

def update_checkin_fields(checkin, data):
# Define a dictionary mapping POST data keys to their respective update functions and expected values
if ('privacy' in data):
print("privacy is in data")
print(type(data.get('privacy')))
print("value of privacy:", data.get('privacy'))

if data.get('privacy'):
print("There should be a value associated")

update_actions = {
'text_entry': (update_text_entry, data.get("text_entry")),
Expand Down Expand Up @@ -761,17 +754,9 @@ def update_content(checkin, new_content):
return HttpResponse("Error in updating content", status=400)

def update_privacy(checkin, new_privacy):
print("it reaches in update_privacy")
try:
# print("Current privacy:", checkin.privacy)
# if (new_privacy == 0):
# checkin.privacy = False
# else:
# checkin.privacy = True
# print("After privacy:",checkin.privacy)
checkin.privacy = new_privacy
checkin.save()
print("After privacy:", checkin.privacy)
logging.info("SUCCESS! Privacy has been updated to \"%s\"", checkin.privacy)
except Exception as e:
logging.info("ERROR IN CHANGING PRIVACY: %s", e)
Expand Down

0 comments on commit e9e309b

Please sign in to comment.