Skip to content

Commit

Permalink
Use htimeseries 6 (fixes #500)
Browse files Browse the repository at this point in the history
  • Loading branch information
aptiko committed Dec 20, 2023
1 parent 36dad1a commit 672232f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions enhydris/tests/admin/test_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,9 @@ def test_message(self):
)


class TimeseriesUploadFileWithUnicodeHeadersTestCase(TestTimeseriesFormMixin, TestCase):
def setUp(self):
@override_settings(ENHYDRIS_USERS_CAN_ADD_CONTENT=True)
class TimeseriesUploadFileSpecialCasesTestCase(TestTimeseriesFormMixin, TestCase):
def test_upload_file_with_unicode_headers(self):
self._create_test_timeseries()
try:
# We check that the file is read without problem even if the locale
Expand All @@ -622,8 +623,11 @@ def setUp(self):
)
finally:
setlocale(LC_CTYPE, saved_locale)
self.assertTrue(self.form.is_valid())

def test_form_is_valid(self):
def test_upload_file_with_only_date(self):
self._create_test_timeseries()
self._create_timeseries_inline_admin_form("REPLACE", b"2020-01-28 18:28\n")
self.assertTrue(self.form.is_valid())


Expand All @@ -643,10 +647,6 @@ def test_file_not_ending_in_line_feed(self):
self._create_timeseries_inline_admin_form("REPLACE", b"2020-01-28 18:28,7,")
self.assertFalse(self.form.is_valid())

def test_file_not_having_enough_columns(self):
self._create_timeseries_inline_admin_form("REPLACE", b"2020-01-28 18:28\n")
self.assertFalse(self.form.is_valid())

def test_file_with_multiple_timestamps(self):
self._create_timeseries_inline_admin_form(
"REPLACE", b"2020-01-28 18:28,7,\n2020-01-28 18:28,8,\n"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Django>=3.2,<4
djangorestframework>=3.9,<4
gdal>=1.6
iso8601
htimeseries>=5,<6
htimeseries>=6,<7
pytz
rules>=2.0
dj-rest-auth==2.1.7
Expand Down

0 comments on commit 672232f

Please sign in to comment.