On 10/07/11 09:45, Ethan Furman wrote:
Tim Chase wrote:
On 10/07/11 07:38, Peter Otten wrote:
def setUp(self):
foo.window_date = functools.partial(foo.window_date,
around=date(2011, 1, 1))
it worked like a charm.
Another option is injection:
import foo
def window_date(...)
Tim Chase wrote:
On 10/07/11 07:38, Peter Otten wrote:
Are there best practices for testing dates that are properties
which take the current date into consideration
The problem is that the behavior of the window_date function
depends on the current date (the function makes a guess about
adding
On 10/07/11 07:38, Peter Otten wrote:
Are there best practices for testing dates that are properties
which take the current date into consideration
The problem is that the behavior of the window_date function
depends on the current date (the function makes a guess about
adding the century if the
Tim Chase wrote:
> Are there best practices for testing dates that are properties
> which take the current date into consideration? I have something
> like
>
>class Foo:
> def _get_year_range(self):
>return (self._min_year, self._max_year)
> def _set_year_range(self, year):
Are there best practices for testing dates that are properties
which take the current date into consideration? I have something
like
class Foo:
def _get_year_range(self):
return (self._min_year, self._max_year)
def _set_year_range(self, year):
if isinstance(year, tuple):