The best way (after having tried at least four different ones) is dependency injection: pass a Clock object or now function to the relevant entrypoint and manipulate that in the test. In pseudo-Python, your test would look something like this:
def function_under_test(foo, bar, clock):
if foo.created < clock.now() + timedelta(days=7):
frobnicate(foo)
Your test would then look like this:
def test_should_frobnicate_foo_if_more_than_a_week_old(self):
clock = StaticClock(datetime.datetime(2000, 1, 1))
foo = Foo(clock) # Sets the creation date to clock.now()
function_under_test(foo)
self.assertTrue(foo.frobnicated)
If you have to black-box test something like this and you're not allowed to change it, you're in trouble. You could try introducing an otherwise redundant configuration variable, passing a "secret" parameter, detecting that the system is being tested, or actually leaving your tests to run for more than a week, but all of those are far from ideal.