Skip to content

Commit b6637d7

Browse files
committed
[openwrt] Fixed tests expecting automatic timezone #87
1 parent cda5e9d commit b6637d7

2 files changed

Lines changed: 4 additions & 18 deletions

File tree

tests/openwisp/test_backend.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,30 +119,20 @@ class TestBackend(unittest.TestCase, _TabsMixin):
119119
}
120120

121121
def test_uci(self):
122-
o = OpenWisp({
123-
"general": {
124-
"hostname": "openwisp-test"
125-
}
126-
})
122+
o = OpenWisp({"general": {"hostname": "openwisp-test"}})
127123
tar = tarfile.open(fileobj=o.generate(), mode='r')
128124
system = tar.getmember('uci/system.conf')
129125
contents = tar.extractfile(system).read().decode()
130126
expected = self._tabs("""package system
131127
132128
config system 'system'
133129
option hostname 'openwisp-test'
134-
option timezone 'UTC'
135-
option zonename 'UTC'
136130
""")
137131
self.assertEqual(contents, expected)
138132
tar.close()
139133

140134
def test_hostname_required(self):
141-
o = OpenWisp({
142-
"general": {
143-
"timezone": "UTC"
144-
}
145-
})
135+
o = OpenWisp({"general": {"timezone": "UTC"}})
146136
with self.assertRaises(ValidationError):
147137
o.validate()
148138

tests/openwrt/test_parser.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ def test_parse_tar_bytesio(self):
214214
{
215215
".type": "system",
216216
".name": "system",
217-
"hostname": "parse-tar-bytesio",
218-
"timezone": "UTC",
219-
"zonename": "UTC"
217+
"hostname": "parse-tar-bytesio"
220218
}
221219
]
222220
}
@@ -231,9 +229,7 @@ def test_parse_tar_file(self):
231229
{
232230
".type": "system",
233231
".name": "system",
234-
"hostname": "parse-tar-file",
235-
"timezone": "UTC",
236-
"zonename": "UTC"
232+
"hostname": "parse-tar-file"
237233
}
238234
]
239235
}

0 commit comments

Comments
 (0)