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

Various #2322

Merged
merged 3 commits into from
Mar 4, 2024
Merged

Various #2322

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions liberapay/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def generate_value(self, currency):

EPOCH = datetime(1970, 1, 1, 0, 0, 0, 0, utc)

EUROZONE = set("AT BE CY DE EE ES FI FR GR IE IT LT LU LV MT NL PT SI SK".split())
SEPA = EUROZONE | set("AD BG CH CZ DK GB GI HR HU IS LI MC NO PL RO SE VA".split())
EUROZONE = set("AT BE CY DE EE ES FI FR GR HR IE IT LT LU LV MT NL PT SI SK".split())
SEPA = EUROZONE | set("AD BG CH CZ DK GB GI HU IS LI MC NO PL RO SE VA".split())

EVENTS = [
Event('income', 1, _("Every week as long as I am receiving donations")),
Expand Down
9 changes: 5 additions & 4 deletions tests/py/test_crypto.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import warnings

import pytest

Expand Down Expand Up @@ -57,13 +58,13 @@ def test_key_rotation(self):
assert new_info_2.payload == new_info.payload

def test_encrypt_dict_warns_of_single_key(self):
with pytest.warns(CryptoWarning, match="dict only contains one key") as warnings:
with pytest.warns(CryptoWarning, match="dict only contains one key") as w:
self.website.cryptograph.encrypt_dict({"long_single_key": None})
assert len(warnings) == 1
with pytest.warns(None) as warnings:
assert len(w) == 1
with warnings.catch_warnings(record=True) as w:
self.website.cryptograph.encrypt_dict({})
self.website.cryptograph.encrypt_dict({0: 1, 2: 3, 4: 5})
assert len(warnings) == 0
assert len(w) == 0

def test_encrypt_dict_randomizes_order(self):
cryptograph = self.website.cryptograph
Expand Down
4 changes: 2 additions & 2 deletions www/%username/edit/goal.spt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ subhead = _("Goal")
<input type="radio" name="goal" id="goal-yes" value="custom"
{{ 'checked' if participant.goal and participant.goal > 0 else '' }}/>
<span>{{ GOAL_PARTS[0] }}</span>
% set goal_currency = participant.main_currency
<input type="hidden" name="currency" value="{{ goal_currency }}" />
<div><div class="input-group">
% set goal_currency = participant.main_currency
<input type="hidden" name="currency" value="{{ goal_currency }}" />
<div class="input-group-addon">{{ locale.currency_symbols.get(goal_currency, goal_currency) }}</div>
<input type="tel" inputmode="decimal" name="goal_custom" id="goal-custom"
class="amount form-control input-sm"
Expand Down
Loading